to use auto-increment feature you need to change the config of your app to use legacy keygeneration:
<auto-id-policy>
legacy
</auto-id-policy>
then you can change your code to the following:
Entity post = new Entity("post");
post.setProperty("content", postContent);
post.setProperty("time", timeStamps);
if you dont pass the ID, appengine will generate it
to use ancestor path you can change your code to the following:
datastore.put(post);
Entity comment = new Entity("comment", post.getKey());
comment.setProperty("content", commentContent);
comment.setProperty("time", timeStamps);
DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
datastore.put(comment);
the ancestor key will be put as a Constructor arg.
instead of auto-increment i would recommend you to use the default key generation, with is not a increment but still unique,
also it should be faster, then legacy