@Override public final Object read(Object[] args) { if (PipeReader.readBytesLength(pipe,fieldLoc)<0) { return null; } else { return PipeReader.readASCII(pipe, fieldLoc, (Appendable)args[0]); } } };
@Override public final Object read(Object[] args) { if (PipeReader.readBytesLength(pipe,fieldLoc)<0) { return null; } else { return PipeReader.readASCII(pipe, fieldLoc, (Appendable)args[0]); } } };
/** * * @param input Pipe arg used for PipeReader.readUTF8 and PipeReader.readBytes */ public static void consumePublish(Pipe<MessageSubscription> input) { StringBuilder fieldTopic = PipeReader.readUTF8(input,MSG_PUBLISH_103_FIELD_TOPIC_1,new StringBuilder(PipeReader.readBytesLength(input,MSG_PUBLISH_103_FIELD_TOPIC_1))); ByteBuffer fieldPayload = PipeReader.readBytes(input,MSG_PUBLISH_103_FIELD_PAYLOAD_3,ByteBuffer.allocate(PipeReader.readBytesLength(input,MSG_PUBLISH_103_FIELD_PAYLOAD_3))); }
/** * * @param input Pipe arg used in PipeReader.readUTF8 and PipeReader.readBytes */ public static void consumePublish(Pipe<IngressMessages> input) { StringBuilder fieldTopic = PipeReader.readUTF8(input,MSG_PUBLISH_103_FIELD_TOPIC_1,new StringBuilder(PipeReader.readBytesLength(input,MSG_PUBLISH_103_FIELD_TOPIC_1))); ByteBuffer fieldPayload = PipeReader.readBytes(input,MSG_PUBLISH_103_FIELD_PAYLOAD_3,ByteBuffer.allocate(PipeReader.readBytesLength(input,MSG_PUBLISH_103_FIELD_PAYLOAD_3))); }
/** * * @param input arg used for PipeReader.readUTF8, PipeReader.readBytesLength and PipeReader.readIntPipeReader.readUTF8, PipeReader.readBytesLength and PipeReader.readInt */ public static void consumeUnsubscribe(Pipe<MessagePubSub> input) { StringBuilder fieldTopic = PipeReader.readUTF8(input,MSG_UNSUBSCRIBE_101_FIELD_TOPIC_1,new StringBuilder(PipeReader.readBytesLength(input,MSG_UNSUBSCRIBE_101_FIELD_TOPIC_1))); int fieldSubscriberIdentityHash = PipeReader.readInt(input,MSG_UNSUBSCRIBE_101_FIELD_SUBSCRIBERIDENTITYHASH_4); }
/** * * @param input Pipe arg used for PipeReader.readUTF8, PipeReader.readBytesLength and PipeReader.readInt */ public static void consumeSubscribe(Pipe<MessagePubSub> input) { StringBuilder fieldTopic = PipeReader.readUTF8(input,MSG_SUBSCRIBE_100_FIELD_TOPIC_1,new StringBuilder(PipeReader.readBytesLength(input,MSG_SUBSCRIBE_100_FIELD_TOPIC_1))); int fieldSubscriberIdentityHash = PipeReader.readInt(input,MSG_SUBSCRIBE_100_FIELD_SUBSCRIBERIDENTITYHASH_4); }
public static void consumeConnect(Pipe<MQTTClientToServerSchema> input) { long fieldTime = PipeReader.readLong(input,MSG_CONNECT_1_FIELD_TIME_37); int fieldKeepAliveSec = PipeReader.readInt(input,MSG_CONNECT_1_FIELD_KEEPALIVESEC_28); int fieldFlags = PipeReader.readInt(input,MSG_CONNECT_1_FIELD_FLAGS_29); StringBuilder fieldClientId = PipeReader.readUTF8(input,MSG_CONNECT_1_FIELD_CLIENTID_30,new StringBuilder(PipeReader.readBytesLength(input,MSG_CONNECT_1_FIELD_CLIENTID_30))); StringBuilder fieldWillTopic = PipeReader.readUTF8(input,MSG_CONNECT_1_FIELD_WILLTOPIC_31,new StringBuilder(PipeReader.readBytesLength(input,MSG_CONNECT_1_FIELD_WILLTOPIC_31))); DataInputBlobReader<MQTTClientToServerSchema> fieldWillPayload = PipeReader.inputStream(input, MSG_CONNECT_1_FIELD_WILLPAYLOAD_32); StringBuilder fieldUser = PipeReader.readUTF8(input,MSG_CONNECT_1_FIELD_USER_33,new StringBuilder(PipeReader.readBytesLength(input,MSG_CONNECT_1_FIELD_USER_33))); StringBuilder fieldPass = PipeReader.readUTF8(input,MSG_CONNECT_1_FIELD_PASS_34,new StringBuilder(PipeReader.readBytesLength(input,MSG_CONNECT_1_FIELD_PASS_34))); } public static void consumeDisconnect(Pipe<MQTTClientToServerSchema> input) {
/** * Checks specified pipe to see if charSeq and value at specific location are equal * @param pipe pipe to be checked * @param loc location of value to compare * @param charSeq CharSequence to compare * @return <code>true</code> if the values are equal else <code>false</code> */ public static boolean isEqual(Pipe pipe, int loc, CharSequence charSeq) { int pos = Pipe.slab(pipe)[pipe.slabMask & (int)(pipe.ringWalker.activeReadFragmentStack[STACK_OFF_MASK&(loc>>STACK_OFF_SHIFT)] + (OFF_MASK&loc))]; return Pipe.isEqual(pipe, charSeq, pos, PipeReader.readBytesLength(pipe,loc)); }
/** * Checks specified pipe to see if charSeq and value at specific location are equal * @param pipe pipe to be checked * @param loc location of value to compare * @param charSeq CharSequence to compare * @return <code>true</code> if the values are equal else <code>false</code> */ public static boolean isEqual(Pipe pipe, int loc, CharSequence charSeq) { int pos = Pipe.slab(pipe)[pipe.slabMask & (int)(pipe.ringWalker.activeReadFragmentStack[STACK_OFF_MASK&(loc>>STACK_OFF_SHIFT)] + (OFF_MASK&loc))]; return Pipe.isEqual(pipe, charSeq, pos, PipeReader.readBytesLength(pipe,loc)); }
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 static void consumeUnSubscribe(Pipe<MQTTClientToServerSchema> input) { long fieldTime = PipeReader.readLong(input,MSG_UNSUBSCRIBE_10_FIELD_TIME_37); int fieldPacketId = PipeReader.readInt(input,MSG_UNSUBSCRIBE_10_FIELD_PACKETID_20); StringBuilder fieldTopic = PipeReader.readUTF8(input,MSG_UNSUBSCRIBE_10_FIELD_TOPIC_23,new StringBuilder(PipeReader.readBytesLength(input,MSG_UNSUBSCRIBE_10_FIELD_TOPIC_23))); } public static void consumePubRec(Pipe<MQTTClientToServerSchema> input) {
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 consumeRequest(Pipe<HTTPLogRequestSchema> input) { long fieldTime = PipeReader.readLong(input,MSG_REQUEST_1_FIELD_TIME_11); long fieldChannelId = PipeReader.readLong(input,MSG_REQUEST_1_FIELD_CHANNELID_12); int fieldSequence = PipeReader.readInt(input,MSG_REQUEST_1_FIELD_SEQUENCE_13); StringBuilder fieldHead = PipeReader.readUTF8(input,MSG_REQUEST_1_FIELD_HEAD_14,new StringBuilder(PipeReader.readBytesLength(input,MSG_REQUEST_1_FIELD_HEAD_14))); }
public static void consumeMessage(Pipe<MQTTClientResponseSchema> input) { int fieldQOS = PipeReader.readInt(input, MSG_MESSAGE_3_FIELD_QOS_21); int fieldRetain = PipeReader.readInt(input, MSG_MESSAGE_3_FIELD_RETAIN_22); int fieldDup = PipeReader.readInt(input, MSG_MESSAGE_3_FIELD_DUP_36); StringBuilder fieldTopic = PipeReader.readUTF8(input, MSG_MESSAGE_3_FIELD_TOPIC_23, new StringBuilder(PipeReader.readBytesLength(input, MSG_MESSAGE_3_FIELD_TOPIC_23))); DataInputBlobReader<MQTTClientResponseSchema> fieldPayload = PipeReader.inputStream(input, MSG_MESSAGE_3_FIELD_PAYLOAD_25); }
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 ASCII from specified pipe * @param pipe to read from * @param loc location of data to read * @return ASCII data */ public static Appendable readASCII(Pipe pipe, int loc, Appendable target) { assert(LOCUtil.isLocOfAnyType(loc, TypeMask.TextASCII, TypeMask.TextASCIIOptional, TypeMask.ByteVector, TypeMask.ByteVectorOptional)): "Value found "+LOCUtil.typeAsString(loc); int pos = Pipe.slab(pipe)[pipe.slabMask & (int)(pipe.ringWalker.activeReadFragmentStack[STACK_OFF_MASK&(loc>>STACK_OFF_SHIFT)] + (OFF_MASK&loc))]; int len = PipeReader.readBytesLength(pipe,loc); return Pipe.readASCII(pipe, target, pos, len); }
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)); }
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); }