public FeedErrorMessage(String operationId) { try { DocumentId id = new DocumentId(operationId); sequenceId = Arrays.hashCode(id.getGlobalId()); } catch (Exception e) { sequenceId = 0; } }
public DocumentState(DocumentId docId, long timestamp, boolean removeEntry) { this.docId = docId; this.gid = new GlobalId(docId.getGlobalId()); this.timestamp = timestamp; this.removeEntry = removeEntry; }
@Override public long getSequenceId() { return Arrays.hashCode(remove.getId().getGlobalId()); }
@Override public long getSequenceId() { deserialize(); return Arrays.hashCode(update.getId().getGlobalId()); }
@Override public long getSequenceId() { deserialize(); return Arrays.hashCode(put.getId().getGlobalId()); }
/** * Only used by PacketCacheTestCase, should not be used otherwise */ public PacketWrapper(CacheKey key, BasicPacket[] packets) { // Should support key == null as this is for testing if (key == null) { keySize = 0; } else { this.keySize = key.byteSize(); } resultPackets.add(packets[0]); this.packets = new LinkedHashMap<>(); this.distributionKey = Optional.empty(); for (int i = 0; i < packets.length - 1; i++) { this.packets.put(new DocsumPacketKey(new GlobalId(new DocumentId("doc:test:" + i).getGlobalId()), i, null), packets[i + 1]); } }
/** * Get the bucket id for a given document. * * @param doc The doc. * @return The bucket id. */ public BucketId getBucketId(DocumentId doc) { long location = doc.getScheme().getLocation(); byte[] gid = doc.getGlobalId(); long gidContribution = getGidContribution(gid); IdString.GidModifier gm = doc.getScheme().getGidModifier(); if (gm != null && gm.usedBits != 0) { gidContribution &= (0xFFFFFFFFFFFFFFFFl << (gm.usedBits + getLocationBitCount())); gidContribution |= (gm.value << getLocationBitCount()); } return new BucketId(64 - BucketId.COUNT_BITS, initialCount | (gidMask & gidContribution) | (locationMask & location)); }