Package com.google.appengine.tools.pipeline.impl.model

Examples of com.google.appengine.tools.pipeline.impl.model.ShardedValue


    final List<Entity> shardedValues = new ArrayList<>(bytes.length / MAX_BLOB_BYTE_SIZE + 1);
    while (offset < bytes.length) {
      int limit = offset + MAX_BLOB_BYTE_SIZE;
      byte[] chunk = Arrays.copyOfRange(bytes, offset, Math.min(limit, bytes.length));
      offset = limit;
      shardedValues.add(new ShardedValue(model, shardId++, chunk).toEntity());
    }
    return tryFiveTimes(new Operation<List<Key>>("serializeValue") {
      @Override
      public List<Key> call() {
        Transaction tx = dataStore.beginTransaction();
View Full Code Here


      ShardedValue[] shardedValues = new ShardedValue[entities.size()];
      int totalSize = 0;
      int index = 0;
      for (Key key : keys) {
        Entity entity = entities.get(key);
        ShardedValue shardedValue = new ShardedValue(entity);
        shardedValues[index++] = shardedValue;
        totalSize += shardedValue.getValue().length;
      }
      byte[] totalBytes = new byte[totalSize];
      int offset = 0;
      for (ShardedValue shardedValue : shardedValues) {
        byte[] shardBytes = shardedValue.getValue();
        System.arraycopy(shardBytes, 0, totalBytes, offset, shardBytes.length);
        offset += shardBytes.length;
      }
      return SerializationUtils.deserialize(totalBytes);
    }
View Full Code Here

TOP

Related Classes of com.google.appengine.tools.pipeline.impl.model.ShardedValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.