Class LocalDatastoreCostAnalysis

java.lang.Object
com.google.appengine.api.datastore.dev.LocalDatastoreCostAnalysis

public class LocalDatastoreCostAnalysis extends Object
Utility class that can calculate the cost of writing (put or delete) a given Entity.
  • Constructor Summary

    Constructors
  • Method Summary

    Modifier and Type
    Method
    Description
    com.google.apphosting.datastore.DatastoreV3Pb.Cost
    getWriteCost(com.google.storage.onestore.v3.OnestoreEntity.EntityProto newEntity)
    Determines the cost of writing this entity, assuming no previous value exists.
    com.google.apphosting.datastore.DatastoreV3Pb.Cost
    getWriteOps(@Nullable com.google.storage.onestore.v3.OnestoreEntity.EntityProto oldEntity, com.google.storage.onestore.v3.OnestoreEntity.EntityProto newEntity)
    Determines the cost of writing newEntity, assuming its current state in the datastore matches oldEntity.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • getWriteCost

      public com.google.apphosting.datastore.DatastoreV3Pb.Cost getWriteCost(com.google.storage.onestore.v3.OnestoreEntity.EntityProto newEntity)
      Determines the cost of writing this entity, assuming no previous value exists.
      Parameters:
      newEntity - The entity whose write cost we are determining.
      Returns:
      The cost of writing the given entity.
    • getWriteOps

      public com.google.apphosting.datastore.DatastoreV3Pb.Cost getWriteOps(@Nullable com.google.storage.onestore.v3.OnestoreEntity.EntityProto oldEntity, com.google.storage.onestore.v3.OnestoreEntity.EntityProto newEntity)
      Determines the cost of writing newEntity, assuming its current state in the datastore matches oldEntity.
      Parameters:
      oldEntity - Entity representing the current state in the datastore. Can be null.
      newEntity - Entity representing the desired state in the datastore.
      Returns:
      The cost of writing newEntity.