public class PipeReader extends Object
| Modifier and Type | Field and Description |
|---|---|
static org.slf4j.Logger |
log |
static int |
OFF_BITS |
static int |
OFF_MASK |
static int |
POS_CONST_MASK |
static double[] |
powdi |
static float[] |
powfi |
static int |
STACK_OFF_MASK |
static int |
STACK_OFF_SHIFT |
| Constructor and Description |
|---|
PipeReader() |
| Modifier and Type | Method and Description |
|---|---|
static int |
bytesConsumedByFragment(Pipe ringBuffer) |
static int |
copyBytes(Pipe sourcePipe,
Pipe targetPipe,
int sourceLOC,
int targetLOC)
Copies bytes from specified pipe to target pipe
|
static void |
copyDecimal(Pipe sourceRing,
Pipe targetRing,
int sourceLOC,
int targetLOC)
Copies decimal from specified pipe ring to target pipe ring
|
static void |
copyInt(Pipe sourceRing,
Pipe targetRing,
int sourceLOC,
int targetLOC)
Copies int from specified pipe ring to target pipe ring
|
static void |
copyLong(Pipe sourcePipe,
Pipe targetPipe,
int sourceLOC,
int targetLOC)
Copies long from specified pipe to target pipe
|
static boolean |
eqASCII(Pipe pipe,
int loc,
CharSequence seq)
Checks to see if CharSequence matches ASCII at given location
|
static boolean |
eqUTF8(Pipe pipe,
int loc,
CharSequence seq)
Checks to see if CharSequence matches UTF8 at given location
|
static int |
getMsgIdx(Pipe rb)
Gets the message index in the pipe
|
static boolean |
hasContentToRead(Pipe pipe)
Checks to see if pipe has content to read
|
static <S extends MessageSchema<S>> |
inputStream(Pipe<S> pipe,
int loc) |
static boolean |
isEqual(Pipe pipe,
int loc,
CharSequence charSeq)
Checks specified pipe to see if charSeq and value at specific location are equal
|
static boolean |
isNewMessage(Pipe ring)
Determines if ring is a new message
|
static boolean |
isNewMessage(com.ociweb.pronghorn.pipe.StackStateWalker rw)
Determines if rw is a new message
|
static boolean |
isStructured(Pipe pipe,
int loc)
Checks to see if pipe is structured at a certain location
|
static byte[] |
peekDataBackingArray(Pipe pipe,
int loc)
Peeks at internal data; advanced feature
|
static int |
peekDataLength(Pipe pipe,
int loc)
Peeks ahead to specified field in pipe before Trie parsing is run
|
static int |
peekDataMeta(Pipe pipe,
int loc) |
static int |
peekDataPosition(Pipe pipe,
int loc) |
static boolean |
peekEquals(Pipe pipe,
int loc,
int expected) |
static <S extends MessageSchema<S>> |
peekInputStream(Pipe<S> pipe,
int loc)
Peeks at input stream of specified pipe before Trie parse is run
|
static int |
peekInt(Pipe pipe,
int loc)
Peeks ahead to specified field in pipe before Trie parsing is done
|
static long |
peekLong(Pipe pipe,
int loc)
Peeks ahead to specified field in pipe before Trie parsing is run
|
static boolean |
peekMsg(Pipe pipe,
int expected)
Checks pipe to see if message equals expected
|
static boolean |
peekMsg(Pipe pipe,
int expected1,
int expected2)
Checks pipe to see if message equals expected
|
static boolean |
peekMsg(Pipe pipe,
int expected1,
int expected2,
int expected3)
Checks pipe to see if message equals expected
|
static boolean |
peekNotMsg(Pipe pipe,
int expected)
Checks pipe to see if message does not equal expected
|
static boolean |
peekNotMsg(Pipe pipe,
int expected1,
int expected2)
Checks pipe to see if message does not equal expected
|
static <A extends Appendable> |
peekUTF8(Pipe pipe,
int loc,
A target)
Peeks ahead to specified field in pipe before Trie parsing is run
|
static void |
printFragment(Pipe input,
Appendable target)
Prints fragment from input to the end of pipe
|
static Appendable |
readASCII(Pipe pipe,
int loc,
Appendable target)
Reads ASCII from specified pipe
|
static int |
readASCII(Pipe pipe,
int loc,
char[] target,
int targetOffset)
Reads ASCII characters in specific location of given pipe
|
static byte |
readByte(Pipe pipe,
int loc)
Reads byte from specified pipe
|
static int |
readBytes(Pipe pipe,
int loc,
byte[] target,
int targetOffset)
Reads byte array at specified location in pipe
|
static int |
readBytes(Pipe pipe,
int loc,
byte[] target,
int targetOffset,
int targetMask)
Reads bytes in given pipe at specified location and populates target with bytes
|
static ByteBuffer |
readBytes(Pipe pipe,
int loc,
ByteBuffer target) |
static DataOutputBlobWriter<?> |
readBytes(Pipe pipe,
int loc,
DataOutputBlobWriter<?> target) |
static byte[] |
readBytesBackingArray(Pipe pipe,
int loc)
An access to internal data structures; advanced feature
|
static int |
readBytesLength(Pipe pipe,
int loc)
Reads the length of bytes at given section of a pipe
|
static int |
readBytesMask(Pipe pipe,
int loc) |
static int |
readBytesPosition(Pipe pipe,
int loc)
Reads positions of bytes at specified location in given pipe
|
static int |
readDecimalExponent(Pipe pipe,
int loc)
Reads decimal exponent from specified pipe
|
static long |
readDecimalMantissa(Pipe pipe,
int loc)
Reads decimal mantissa from specified pipe
|
static double |
readDouble(Pipe pipe,
int loc)
Reads double from specified pipe
|
static void |
readFieldIntoDataOutput(int loc,
Pipe pipe,
DataOutput out) |
static void |
readFieldIntoOutputStream(int loc,
Pipe pipe,
OutputStream out)
Reads specified field in given pipe into the OutputStream
|
static float |
readFloat(Pipe pipe,
int loc)
Reads float from specified pipe
|
static int |
readInt(Pipe pipe,
int loc)
Reads int from specified pipe
|
static float |
readIntBitsToFloat(Pipe pipe,
int loc)
Reads int bits from specified pipe and converts to float
|
static int |
readIntSecure(Pipe pipe,
int loc,
int clearValue)
Reads int securely from specified pipe
|
static long |
readLong(Pipe pipe,
int loc)
Reads long from specified pipe
|
static double |
readLongBitsToDouble(Pipe pipe,
int loc)
Reads long bits from specified pipe and converts to double
|
static boolean |
readNextWithoutReleasingReadLock(Pipe pipe)
Reads next message without allowing ReadLock to be overwritten
|
static short |
readShort(Pipe pipe,
int loc)
Reads short from specified pipe
|
static <A extends Appendable> |
readUTF8(Pipe pipe,
int loc,
A target)
Reads UTF8 from specified pipe
|
static int |
readUTF8(Pipe pipe,
int loc,
char[] target,
int targetOffset)
Reads UTF8 in specified pipe and writes characters to char[]
|
static void |
releaseAllPendingReadLock(Pipe pipe)
Release all pending records
|
static void |
releaseAllPendingReadLock(Pipe pipe,
int consumed) |
static int |
releaseReadLock(Pipe pipe)
Release the record which has been most recently read.
|
static int |
sizeOfFragment(Pipe input)
Gives the size of the fragment from input to the end of pipe
|
static boolean |
tryMoveSingleMessage(Pipe pipeIn,
Pipe pipeOut)
Copies current message from input ring to output ring.
|
static <S extends MessageSchema<S>> |
tryReadFragment(Pipe<S> pipe) |
static ByteBuffer[] |
wrappedUnstructuredLayoutBuffer(Pipe pipe,
int loc) |
public static final int POS_CONST_MASK
public static final int OFF_MASK
public static final int STACK_OFF_MASK
public static final int STACK_OFF_SHIFT
public static final int OFF_BITS
public static final org.slf4j.Logger log
public static final double[] powdi
public static final float[] powfi
public static <S extends MessageSchema<S>> DataInputBlobReader<S> inputStream(Pipe<S> pipe, int loc)
public static int readInt(Pipe pipe, int loc)
pipe - to read fromloc - location of int to readpublic static int readIntSecure(Pipe pipe, int loc, int clearValue)
pipe - to read fromloc - location of int to readclearValue - value to replace previous int withpublic static short readShort(Pipe pipe, int loc)
pipe - to be readloc - location of short to readpublic static byte readByte(Pipe pipe, int loc)
pipe - to be readloc - location of byte to readpublic static long readLong(Pipe pipe, int loc)
pipe - to be readloc - location of long to readpublic static double readDouble(Pipe pipe, int loc)
pipe - to be readloc - location of double to readpublic static double readLongBitsToDouble(Pipe pipe, int loc)
pipe - to be readloc - location of long bits to readpublic static float readFloat(Pipe pipe, int loc)
pipe - to be readloc - location of float to readpublic static float readIntBitsToFloat(Pipe pipe, int loc)
pipe - to be readloc - location of int bits to readpublic static int readDecimalExponent(Pipe pipe, int loc)
pipe - to read fromloc - location to read frompublic static long readDecimalMantissa(Pipe pipe, int loc)
pipe - to read fromloc - location to read frompublic static boolean isEqual(Pipe pipe, int loc, CharSequence charSeq)
pipe - pipe to be checkedloc - location of value to comparecharSeq - CharSequence to comparetrue if the values are equal else falsepublic static Appendable readASCII(Pipe pipe, int loc, Appendable target)
pipe - to read fromloc - location of data to readpublic static <A extends Appendable> A readUTF8(Pipe pipe, int loc, A target)
pipe - to read fromloc - location of data to readpublic static int readUTF8(Pipe pipe, int loc, char[] target, int targetOffset)
pipe - to readloc - location to read fromtarget - char array to write UTF8 topublic static int readASCII(Pipe pipe, int loc, char[] target, int targetOffset)
pipe - to be read fromloc - location to read fromtarget - char[] to write ASCII data topublic static boolean eqUTF8(Pipe pipe, int loc, CharSequence seq)
pipe - to be read fromloc - to read UTF8 fromseq - CharSequence to comparetrue if they are equal else falsepublic static boolean eqASCII(Pipe pipe, int loc, CharSequence seq)
pipe - to be read fromloc - to read ASCII fromseq - CharSequence to comparetrue if they are equal else falsepublic static int readBytesLength(Pipe pipe, int loc)
pipe - to read fromloc - location of bytes to readpublic static int readBytesMask(Pipe pipe, int loc)
public static int readBytesPosition(Pipe pipe, int loc)
pipe - to readloc - location to read frompublic static boolean isStructured(Pipe pipe, int loc)
pipe - to readloc - location to checktrue if pipe is structuredpublic static byte[] readBytesBackingArray(Pipe pipe, int loc)
public static ByteBuffer readBytes(Pipe pipe, int loc, ByteBuffer target)
public static DataOutputBlobWriter<?> readBytes(Pipe pipe, int loc, DataOutputBlobWriter<?> target)
public static ByteBuffer[] wrappedUnstructuredLayoutBuffer(Pipe pipe, int loc)
public static int readBytes(Pipe pipe, int loc, byte[] target, int targetOffset)
pipe - pipe to checkloc - location to read fromtarget - target byte arraypublic static int readBytes(Pipe pipe, int loc, byte[] target, int targetOffset, int targetMask)
pipe - pipe to read fromloc - location to read fromtarget - byte array to write topublic static void copyInt(Pipe sourceRing, Pipe targetRing, int sourceLOC, int targetLOC)
sourceRing - to copy fromtargetRing - to copy tosourceLOC - location of the int to copytargetLOC - location to put the copied intpublic static void copyLong(Pipe sourcePipe, Pipe targetPipe, int sourceLOC, int targetLOC)
sourcePipe - to copy fromtargetPipe - to copy tosourceLOC - location of long to copytargetLOC - location to put copied longpublic static void copyDecimal(Pipe sourceRing, Pipe targetRing, int sourceLOC, int targetLOC)
sourceRing - to copy fromtargetRing - to copy tosourceLOC - location of decimal to copytargetLOC - location to put copied decimalpublic static int copyBytes(Pipe sourcePipe, Pipe targetPipe, int sourceLOC, int targetLOC)
sourcePipe - to copy fromtargetPipe - to copy tosourceLOC - location of bytes to copytargetLOC - location to put bytespublic static boolean tryMoveSingleMessage(Pipe pipeIn, Pipe pipeOut)
pipeIn - pipeOut - public static boolean isNewMessage(com.ociweb.pronghorn.pipe.StackStateWalker rw)
rw - StackStateWalker checked to see if it is a new messagetrue if rm is a new message, else falsepublic static boolean isNewMessage(Pipe ring)
ring - Pipe checked to see if it is a new messagetrue if ring is a new message, else falsepublic static int getMsgIdx(Pipe rb)
rb - pipe to find index inpublic static int bytesConsumedByFragment(Pipe ringBuffer)
public static boolean hasContentToRead(Pipe pipe)
pipe - to be checkedtrue if pipe has content, else falsepublic static boolean peekEquals(Pipe pipe, int loc, int expected)
pipe - loc - expected - public static boolean peekMsg(Pipe pipe, int expected)
pipe - to be checkedexpected - used for comparison with messagetrue if message == expected, else falsepublic static boolean peekMsg(Pipe pipe, int expected1, int expected2)
pipe - to be checkedexpected1 - used for comparison with messageexpected2 - used for comparison with messagetrue if message == expected1 && expected2, else falsepublic static boolean peekMsg(Pipe pipe, int expected1, int expected2, int expected3)
pipe - to be checkedexpected1 - used for comparison with messageexpected2 - used for comparison with messageexpected3 - used for comparison with messagetrue if message == expected1, expected2 && expected3, else falsepublic static boolean peekNotMsg(Pipe pipe, int expected)
pipe - to be checkedexpected - used for comparisontrue if message != expected, else falsepublic static boolean peekNotMsg(Pipe pipe, int expected1, int expected2)
pipe - to be checkedexpected1 - used for comparisonexpected2 - used for comparisontrue if message != expected1 && message != expected2, else falsepublic static int peekInt(Pipe pipe, int loc)
pipe - pipe to readloc - field to peek inpublic static long peekLong(Pipe pipe, int loc)
pipe - pipe to readloc - field to peek inpublic static <A extends Appendable> A peekUTF8(Pipe pipe, int loc, A target)
pipe - pipe to readloc - field to peek inpublic static int peekDataLength(Pipe pipe, int loc)
pipe - pipe to readloc - field to peek inpublic static int peekDataPosition(Pipe pipe, int loc)
public static int peekDataMeta(Pipe pipe, int loc)
public static byte[] peekDataBackingArray(Pipe pipe, int loc)
public static <S extends MessageSchema<S>> DataInputBlobReader<S> peekInputStream(Pipe<S> pipe, int loc)
pipe - pipe to readpublic static <S extends MessageSchema<S>> boolean tryReadFragment(Pipe<S> pipe)
public static int releaseReadLock(Pipe pipe)
pipe - The pipe where this message is found.public static void releaseAllPendingReadLock(Pipe pipe)
pipe - the pipe where this message is foundpublic static void releaseAllPendingReadLock(Pipe pipe, int consumed)
public static boolean readNextWithoutReleasingReadLock(Pipe pipe)
pipe - pipe where this message is foundpublic static int sizeOfFragment(Pipe input)
input - starting point from which to measure fragmentpublic static void printFragment(Pipe input, Appendable target)
input - starting point from which to print fragmenttarget - where to print fragmentpublic static void readFieldIntoOutputStream(int loc,
Pipe pipe,
OutputStream out)
throws IOException
loc - field to read to streampipe - to be read fromout - stream to read intoIOExceptionpublic static void readFieldIntoDataOutput(int loc,
Pipe pipe,
DataOutput out)
throws IOException
IOExceptionCopyright © 2018. All Rights Reserved.