/** * Writes field from data input in given pipe and location * @param pipe to write to * @param loc location to write field * @param dataInput data used to write field * @param byteCount max bytes in field */ public static void writeFieldFromDataInput(Pipe pipe, int loc, DataInput dataInput, final int byteCount) throws IOException { buildFieldFromDataInput(pipe, loc, dataInput, byteCount, PipeReader.readBytesPosition(pipe, loc), PipeReader.readBytesMask(pipe, loc), PipeReader.readBytesBackingArray(pipe, loc), pipe.sizeOfBlobRing, PipeReader.readBytesPosition(pipe, loc), byteCount, 0); }
/** * Writes field from data input in given pipe and location * @param pipe to write to * @param loc location to write field * @param dataInput data used to write field * @param byteCount max bytes in field */ public static void writeFieldFromDataInput(Pipe pipe, int loc, DataInput dataInput, final int byteCount) throws IOException { buildFieldFromDataInput(pipe, loc, dataInput, byteCount, PipeReader.readBytesPosition(pipe, loc), PipeReader.readBytesMask(pipe, loc), PipeReader.readBytesBackingArray(pipe, loc), pipe.sizeOfBlobRing, PipeReader.readBytesPosition(pipe, loc), byteCount, 0); }
/** * Writes field from data received in the input stream * @param pipe to write to * @param loc location to write field * @param inputStream to get data to write field * @param byteCount max bytes in field */ public static void writeFieldFromInputStream(Pipe pipe, int loc, InputStream inputStream, final int byteCount) throws IOException { buildFieldFromInputStream(pipe, loc, inputStream, byteCount, PipeReader.readBytesPosition(pipe, loc), PipeReader.readBytesMask(pipe, loc), PipeReader.readBytesBackingArray(pipe, loc), pipe.sizeOfBlobRing, PipeReader.readBytesPosition(pipe, loc), byteCount, 0); }
/** * Writes field from data received in the input stream * @param pipe to write to * @param loc location to write field * @param inputStream to get data to write field * @param byteCount max bytes in field */ public static void writeFieldFromInputStream(Pipe pipe, int loc, InputStream inputStream, final int byteCount) throws IOException { buildFieldFromInputStream(pipe, loc, inputStream, byteCount, PipeReader.readBytesPosition(pipe, loc), PipeReader.readBytesMask(pipe, loc), PipeReader.readBytesBackingArray(pipe, loc), pipe.sizeOfBlobRing, PipeReader.readBytesPosition(pipe, loc), byteCount, 0); }
/** * Writes field from data input in given pipe and location * @param pipe to write to * @param loc location to write field * @param dataInput data used to write field * @param byteCount max bytes in field */ public static void writeFieldFromDataInput(Pipe pipe, int loc, DataInput dataInput, final int byteCount) throws IOException { buildFieldFromDataInput(pipe, loc, dataInput, byteCount, PipeReader.readBytesPosition(pipe, loc), PipeReader.readBytesMask(pipe, loc), PipeReader.readBytesBackingArray(pipe, loc), pipe.sizeOfBlobRing, PipeReader.readBytesPosition(pipe, loc), byteCount, 0); }
public void openHighLevelAPIField(int loc) { this.length = PipeReader.readBytesLength(pipe, loc); this.position = PipeReader.readBytesPosition(pipe, loc); this.backing = PipeReader.readBytesBackingArray(pipe, loc); this.bytesLimit = pipe.blobMask & (position + length); }
public void openHighLevelAPIField(int loc) { this.length = PipeReader.readBytesLength(pipe, loc); this.position = PipeReader.readBytesPosition(pipe, loc); this.backing = PipeReader.readBytesBackingArray(pipe, loc); this.bytesLimit = pipe.blobMask & (position + length); }
public void openHighLevelAPIField(int loc) { this.length = PipeReader.readBytesLength(pipe, loc); this.position = PipeReader.readBytesPosition(pipe, loc); this.backing = PipeReader.readBytesBackingArray(pipe, loc); this.bytesLimit = pipe.blobMask & (position + length); }
public int openHighLevelAPIField(int loc) { this.isStructured = PipeReader.isStructured(pipe, loc); this.length = Math.max(0, PipeReader.readBytesLength(pipe, loc)); this.bytesLowBound = this.position = PipeReader.readBytesPosition(pipe, loc); this.backing = PipeReader.readBytesBackingArray(pipe, loc); assert(this.backing!=null) : "The pipe must be init before use."; this.bytesHighBound = pipe.blobMask & (position + length); assert(Pipe.validatePipeBlobHasDataToRead(pipe, position, length)); return this.length; }
public int openHighLevelAPIField(int loc) { this.isStructured = PipeReader.isStructured(pipe, loc); this.length = Math.max(0, PipeReader.readBytesLength(pipe, loc)); this.bytesLowBound = this.position = PipeReader.readBytesPosition(pipe, loc); this.backing = PipeReader.readBytesBackingArray(pipe, loc); assert(this.backing!=null) : "The pipe must be init before use."; this.bytesHighBound = pipe.blobMask & (position + length); assert(Pipe.validatePipeBlobHasDataToRead(pipe, position, length)); return this.length; }
public static void parseSetup(TrieParserReader trieReader, int loc, Pipe<?> input) { parseSetup(trieReader, PipeReader.readBytesBackingArray(input, loc), PipeReader.readBytesPosition(input, loc), PipeReader.readBytesLength(input, loc), PipeReader.readBytesMask(input, loc)); }
/** * Reads specified field in given pipe into the OutputStream * @param loc field to read to stream * @param pipe to be read from * @param out stream to read into */ public static void readFieldIntoOutputStream(int loc, Pipe pipe, OutputStream out) throws IOException { int length = readBytesLength(pipe, loc); if (length>0) { int off = readBytesPosition(pipe, loc) & Pipe.blobMask(pipe); copyFieldToOutputStream(out, length, readBytesBackingArray(pipe, loc), off, pipe.sizeOfBlobRing-off); } }
public static void parseSetup(TrieParserReader trieReader, int loc, Pipe<?> input) { parseSetup(trieReader, PipeReader.readBytesBackingArray(input, loc), PipeReader.readBytesPosition(input, loc), PipeReader.readBytesLength(input, loc), PipeReader.readBytesMask(input, loc)); }
/** * Reads specified field in given pipe into the OutputStream * @param loc field to read to stream * @param pipe to be read from * @param out stream to read into */ public static void readFieldIntoOutputStream(int loc, Pipe pipe, OutputStream out) throws IOException { int length = readBytesLength(pipe, loc); if (length>0) { int off = readBytesPosition(pipe, loc) & Pipe.blobMask(pipe); copyFieldToOutputStream(out, length, readBytesBackingArray(pipe, loc), off, pipe.sizeOfBlobRing-off); } }
public static void readFieldIntoDataOutput(int loc, Pipe pipe, DataOutput out) throws IOException { int length = readBytesLength(pipe, loc); if (length>0) { int off = readBytesPosition(pipe, loc) & Pipe.blobMask(pipe); copyFieldToDataOutput(out, length, readBytesBackingArray(pipe, loc), off, pipe.sizeOfBlobRing-off); } }
public static void parseSetup(TrieParserReader trieReader, int loc, Pipe<?> input) { parseSetup(trieReader, PipeReader.readBytesBackingArray(input, loc), PipeReader.readBytesPosition(input, loc), PipeReader.readBytesLength(input, loc), PipeReader.readBytesMask(input, loc)); }
public static void readFieldIntoDataOutput(int loc, Pipe pipe, DataOutput out) throws IOException { int length = readBytesLength(pipe, loc); if (length>0) { int off = readBytesPosition(pipe, loc) & Pipe.blobMask(pipe); copyFieldToDataOutput(out, length, readBytesBackingArray(pipe, loc), off, pipe.sizeOfBlobRing-off); } }
int ingressCollectSubLists(Pipe<IngressMessages> ingessPipe) { foundWork=true; final byte[] backing = PipeReader.readBytesBackingArray(ingessPipe, IngressMessages.MSG_PUBLISH_103_FIELD_TOPIC_1); final int pos = PipeReader.readBytesPosition(ingessPipe, IngressMessages.MSG_PUBLISH_103_FIELD_TOPIC_1); final int len = PipeReader.readBytesLength(ingessPipe, IngressMessages.MSG_PUBLISH_103_FIELD_TOPIC_1); final int mask = PipeReader.readBytesMask(ingessPipe, IngressMessages.MSG_PUBLISH_103_FIELD_TOPIC_1); int listIdx = subscriptionListIdx(backing, pos, len, mask); collectAllSubscriptionLists(backing, pos, len, mask); return listIdx; }
void unsubscribe(Pipe<MessagePubSub> pipe) { int hash = PipeReader.readInt(pipe, MessagePubSub.MSG_UNSUBSCRIBE_101_FIELD_SUBSCRIBERIDENTITYHASH_4); final short pipeIdx = (short)IntHashTable.getItem(subscriptionPipeLookup, hash); assert(pipeIdx>=0) : "Must have valid pipe index"; final byte[] backing = PipeReader.readBytesBackingArray(pipe, MessagePubSub.MSG_UNSUBSCRIBE_101_FIELD_TOPIC_1); final int pos = PipeReader.readBytesPosition(pipe, MessagePubSub.MSG_UNSUBSCRIBE_101_FIELD_TOPIC_1); final int len = PipeReader.readBytesLength(pipe, MessagePubSub.MSG_UNSUBSCRIBE_101_FIELD_TOPIC_1); final int mask = PipeReader.readBytesMask(pipe, MessagePubSub.MSG_UNSUBSCRIBE_101_FIELD_TOPIC_1); unsubscribe(pipeIdx, backing, pos, len, mask); }
void addSubscription(Pipe<MessagePubSub> pipe) { //hash of the subscribing object int hash = PipeReader.readInt(pipe, MessagePubSub.MSG_SUBSCRIBE_100_FIELD_SUBSCRIBERIDENTITYHASH_4); //convert the hash into the specific outgoing pipe where this will go final short pipeIdx = (short)IntHashTable.getItem(subscriptionPipeLookup, hash); assert(pipeIdx>=0) : "Must have valid pipe index"; final byte[] backing = PipeReader.readBytesBackingArray(pipe, MessagePubSub.MSG_SUBSCRIBE_100_FIELD_TOPIC_1); final int pos = PipeReader.readBytesPosition(pipe, MessagePubSub.MSG_SUBSCRIBE_100_FIELD_TOPIC_1); final int len = PipeReader.readBytesLength(pipe, MessagePubSub.MSG_SUBSCRIBE_100_FIELD_TOPIC_1); final int mask = PipeReader.readBytesMask(pipe, MessagePubSub.MSG_SUBSCRIBE_100_FIELD_TOPIC_1); addSubscription(pipeIdx, backing, pos, len, mask); }