data = ByteContainer.simple(bytes);
}
// 19-Sep-2013, tatu: May need to upsert, when resolving conflicts
result = entryStore.upsertConditionally(StoreOperationSource.SYNC, null, key, data,
stdMetadata, customMetadata, true,
new ConflictOverwriteChecker(reqEntry.insertionTime));
} else {
/* 21-Sep-2012, tatu: Important -- we must ensure that store only reads
* bytes that belong to the entry payload. The easiest way is by adding
* a wrapper stream that ensures this...
*/
BoundedInputStream bin = new BoundedInputStream(in, stdMetadata.storageSize, false);
// 19-Sep-2013, tatu: May need to upsert, when resolving conflicts
result = entryStore.upsertConditionally(StoreOperationSource.SYNC, null, key, bin,
stdMetadata, customMetadata, true,
new ConflictOverwriteChecker(reqEntry.insertionTime));
if (result.succeeded() && !bin.isCompletelyRead()) { // error or warning?
Storable entry = result.getNewEntry();
long ssize = (entry == null) ? -1L : entry.getStorageLength();
++probs.other;