public byte[] getGlobalId() { if (globalId == null) { globalId = new GlobalId(id); } return globalId.getRawId(); }
/** * Fills this packet from a byte buffer positioned at the * first byte of the packet */ public void decodeBody(ByteBuffer buffer) { byte[] rawGid = new byte[GlobalId.LENGTH]; buffer.get(rawGid); globalId = new GlobalId(rawGid); data=new byte[getLength()-12-GlobalId.LENGTH]; buffer.get(data); }
public DocumentState(DocumentId docId, long timestamp, boolean removeEntry) { this.docId = docId; this.gid = new GlobalId(docId.getGlobalId()); this.timestamp = timestamp; this.removeEntry = removeEntry; }
DocumentInfo(ByteBuffer buffer, QueryResultPacket owner) { byte[] rawGid = new byte[GlobalId.LENGTH]; buffer.get(rawGid); globalId = new GlobalId(rawGid); metric = decodeMetric(buffer); partId = owner.getMldFeature() ? buffer.getInt() : 0; distributionKey = owner.getMldFeature() ? buffer.getInt() : 0; }
/** * 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]); } }
public DocumentState(Deserializer buf) { byte hasDocId = buf.getByte(null); if (hasDocId == (byte) 1) { docId = new DocumentId(buf); } gid = new GlobalId(buf); timestamp = buf.getLong(null); removeEntry = buf.getByte(null)>0; }