public class PipeWriter extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
OFF_BITS |
static int |
OFF_MASK |
static double[] |
powd |
static int |
STACK_OFF_MASK |
static int |
STACK_OFF_SHIFT |
| Constructor and Description |
|---|
PipeWriter() |
| Modifier and Type | Method and Description |
|---|---|
static void |
accumulateBitsValue(Pipe pipe,
int loc,
int value) |
static void |
blockWriteFragment(Pipe pipe,
int messageTemplateLOC)
Deprecated.
|
static boolean |
hasRoomForFragmentOfSize(Pipe pipe,
int fragSize)
Checks to see if specified pipe has room for a specific size of data
|
static boolean |
hasRoomForWrite(Pipe pipe)
Check to see if specified pipe has room to write
|
static <S extends MessageSchema<S>> |
outputStream(Pipe<S> pipe)
Gives outputStream of specified pipe
|
static void |
presumeWriteFragment(Pipe pipe,
int fragmentId)
We assume that the pipe has room and this was already checked earlier in the code.
|
static void |
publishEOF(Pipe pipe)
This sends a poison pill.
|
static void |
publishEOF(Pipe[] pipe)
This sends a poison pill.
|
static void |
publishEOL(Pipe pipe)
This sends a poison pill.
|
static int |
publishWrites(Pipe pipe) |
static void |
setPublishBatchSize(Pipe pipe,
int size)
Sets batch size to be published
|
static long |
structuredPositionForLOC(Pipe pipe,
int loc)
Makes specified location in pipe structured
|
static boolean |
tryReplication(Pipe pipe,
long historicSlabPosition,
int historicBlobPosition)
Copy message previously sent and publish it again.
|
static boolean |
tryWriteFragment(Pipe pipe,
int fragmentId)
Return true if there is room for the desired fragment in the output buffer.
|
static void |
wrappedUnstructuredLayoutBufferCancel(Pipe<?> target) |
static void |
wrappedUnstructuredLayoutBufferClose(Pipe<?> target,
int loc,
int length)
Specifies to close the field
|
static ByteBuffer[] |
wrappedUnstructuredLayoutBufferOpen(Pipe<?> target,
int loc)
Does not require tryWrite to be called first, we only need to check that there is room to write.
|
static ByteBuffer[] |
wrappedUnstructuredLayoutBufferOpen(Pipe<?> target,
int maxLength,
int loc)
Does not require tryWrite to be called first, we only need to check that there is room to write.
|
static void |
writeASCII(Pipe pipe,
int loc,
char[] source)
Writes ASCII to defined location in specified pipe
|
static void |
writeASCII(Pipe pipe,
int loc,
char[] source,
int offset,
int length)
Writes ASCII to specified location in given pipe
|
static void |
writeASCII(Pipe pipe,
int loc,
CharSequence source)
Writes ASCII to defined location in specified pipe
|
static void |
writeASCII(Pipe pipe,
int loc,
CharSequence source,
int offset,
int length)
Writes ASCII to specified location in given pipe
|
static void |
writeByte(Pipe pipe,
int loc,
byte value)
Writes byte to specified pipe
|
static void |
writeBytes(Pipe pipe,
int loc,
byte[] source)
Writes bytes to given pipe at specified location
|
static void |
writeBytes(Pipe pipe,
int loc,
byte[] source,
int offset,
int length)
Writes bytes to given pipe at specified location
|
static void |
writeBytes(Pipe pipe,
int loc,
byte[] source,
int offset,
int length,
int mask)
Writes bytes to given pipe at specified location
|
static void |
writeBytes(Pipe pipe,
int loc,
ByteBuffer source)
Writes bytes to given pipe at specified location
|
static void |
writeBytes(Pipe pipe,
int loc,
ByteBuffer source,
int length)
Writes bytes to given pipe at specified location
|
static void |
writeDecimal(Pipe pipe,
int loc,
int exponent,
long mantissa)
Writes decimal to specified pipe
|
static void |
writeDouble(Pipe pipe,
int loc,
double value,
int places)
Writes double to specific location in pipe
|
static void |
writeDoubleAsLongBits(Pipe pipe,
int loc,
double value)
Writes double to specified pipe as long bits
|
static void |
writeFieldFromDataInput(Pipe pipe,
int loc,
DataInput dataInput,
int byteCount)
Writes field from data input in given pipe and location
|
static void |
writeFieldFromInputStream(Pipe pipe,
int loc,
InputStream inputStream,
int byteCount)
Writes field from data received in the input stream
|
static void |
writeFloat(Pipe pipe,
int loc,
float value,
int places)
Writes float to specific location in pipe
|
static void |
writeFloatAsIntBits(Pipe pipe,
int loc,
float value) |
static void |
writeInt(Pipe pipe,
int loc,
int value)
Writes int to specified pipe
|
static void |
writeIntAsText(Pipe pipe,
int loc,
int value)
Writes given int as String in specified pipe
|
static void |
writeLong(Pipe pipe,
int loc,
long value)
Writes long to specified pipe
|
static void |
writeLongAsText(Pipe pipe,
int loc,
long value)
Writes a long as a String in given pipe
|
static void |
writeShort(Pipe pipe,
int loc,
short value)
Writes short to specified pipe
|
static void |
writeSpecialBytesPosAndLen(Pipe pipe,
int loc,
int length,
int bytePos)
Writes bytes with specific position and length to given pipe
|
static void |
writeUTF8(Pipe pipe,
int loc,
char[] source)
Writes UTF8 to defined location in specified pipe
|
static void |
writeUTF8(Pipe pipe,
int loc,
char[] source,
int offset,
int length)
Writes UTF8 to specified location in given pipe
|
static void |
writeUTF8(Pipe pipe,
int loc,
CharSequence source)
Writes UTF8 to defined location in specified pipe
|
static void |
writeUTF8(Pipe pipe,
int loc,
CharSequence source,
int offset,
int length)
Writes UTF8 to specified location in given pipe
|
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 double[] powd
public static void writeInt(Pipe pipe, int loc, int value)
pipe - pipe to be written toloc - location to write intvalue - int value to be writtenpublic static void accumulateBitsValue(Pipe pipe, int loc, int value)
pipe - to be updatedloc - for the field to be updatedvalue - to be ORed with the existing data in this positionpublic static void writeShort(Pipe pipe, int loc, short value)
pipe - to be updatedloc - for the field to be updatedvalue - short to write to specified locationpublic static void writeByte(Pipe pipe, int loc, byte value)
pipe - to be updatedloc - for the field to be updatedvalue - byte to write to specified locationpublic static void writeLong(Pipe pipe, int loc, long value)
pipe - to be updatedloc - for the field to be updatedvalue - long to write to specified locationpublic static void writeDecimal(Pipe pipe, int loc, int exponent, long mantissa)
pipe - to be written toloc - location to write topublic static long structuredPositionForLOC(Pipe pipe, int loc)
pipe - to write toloc - location to write topublic static void writeFloat(Pipe pipe, int loc, float value, int places)
pipe - to be written toloc - location to writevalue - float to be writtenplaces - to write values inpublic static void writeDouble(Pipe pipe, int loc, double value, int places)
pipe - to be written toloc - location to writevalue - double to be writtenplaces - to write values inpublic static void writeFloatAsIntBits(Pipe pipe, int loc, float value)
pipe - to be updatedloc - for the field to be updatedvalue - float to write to specified locationpublic static void writeDoubleAsLongBits(Pipe pipe, int loc, double value)
pipe - to write toloc - location to write tovalue - double to be convertedpublic static void writeBytes(Pipe pipe, int loc, byte[] source, int offset, int length)
pipe - to be written toloc - location to write tosource - byte array used to write dataoffset - number to offset byteslength - length of bytes to writepublic static void writeBytes(Pipe pipe, int loc, byte[] source, int offset, int length, int mask)
pipe - to be written toloc - location to write tosource - byte array used to write dataoffset - number to offset byteslength - length of bytes to writemask - for looping around the arraypublic static void writeBytes(Pipe pipe, int loc, byte[] source)
pipe - to be written toloc - location to writesource - byte array used to write datapublic static void writeBytes(Pipe pipe, int loc, ByteBuffer source)
pipe - to be written toloc - location to writesource - ByteBuffer used to write datapublic static void writeBytes(Pipe pipe, int loc, ByteBuffer source, int length)
pipe - to be written toloc - location to writesource - ByteBuffer used to write datalength - length of bytes to writepublic static void writeSpecialBytesPosAndLen(Pipe pipe, int loc, int length, int bytePos)
pipe - to be written toloc - location to writelength - length of bytes to writebytePos - position in field to write bytespublic static void writeUTF8(Pipe pipe, int loc, CharSequence source)
pipe - to be written toloc - for the field to be updatedsource - CharSequence to write to specified locationpublic static void writeUTF8(Pipe pipe, int loc, CharSequence source, int offset, int length)
pipe - to be written toloc - field to be written tosource - CharSequence to writeoffset - number of UTF8 to offsetlength - length of data writtenpublic static void writeUTF8(Pipe pipe, int loc, char[] source)
pipe - to be written toloc - field to be written tosource - char[] to write to specified locationpublic static void writeUTF8(Pipe pipe, int loc, char[] source, int offset, int length)
pipe - to be written toloc - field to be written tosource - char[] to write to fieldoffset - char offsetlength - length of data to be writtenpublic static void writeASCII(Pipe pipe, int loc, char[] source)
pipe - to be updatedloc - for the field to be updatedsource - char[] to write to specified locationpublic static void writeASCII(Pipe pipe, int loc, char[] source, int offset, int length)
pipe - to be written toloc - field to write tosource - char[] to write to fieldoffset - char[] offsetlength - length of data to be writtenpublic static void writeASCII(Pipe pipe, int loc, CharSequence source)
pipe - to be updatedloc - for the field to be updatedsource - CharSequence to write to specified locationpublic static void writeASCII(Pipe pipe, int loc, CharSequence source, int offset, int length)
pipe - to be written toloc - field to write tosource - CharSequence to write to fieldoffset - CharSequence offsetlength - length of data to be writtenpublic static void writeIntAsText(Pipe pipe, int loc, int value)
pipe - to be written toloc - field to write datavalue - int value to be convertedpublic static void writeLongAsText(Pipe pipe, int loc, long value)
pipe - to be updatedloc - for field to be updatedvalue - long to write to specified locationpublic static void publishEOF(Pipe[] pipe)
pipe - to send pillpublic static void publishEOF(Pipe pipe)
pipe - to send pillpublic static void publishEOL(Pipe pipe)
pipe - to send pillpublic static int publishWrites(Pipe pipe)
@Deprecated public static void blockWriteFragment(Pipe pipe, int messageTemplateLOC)
public static boolean tryReplication(Pipe pipe, long historicSlabPosition, int historicBlobPosition)
public static void presumeWriteFragment(Pipe pipe, int fragmentId)
public static boolean tryWriteFragment(Pipe pipe, int fragmentId)
public static boolean hasRoomForWrite(Pipe pipe)
pipe - to be checkedtrue if pipe has room else falsepublic static boolean hasRoomForFragmentOfSize(Pipe pipe, int fragSize)
pipe - to be checkedfragSize - size of data to addtrue if data fragment fits else falsepublic static void setPublishBatchSize(Pipe pipe, int size)
pipe - to be written tosize - of batchpublic static void writeFieldFromInputStream(Pipe pipe, int loc, InputStream inputStream, int byteCount) throws IOException
pipe - to write toloc - location to write fieldinputStream - to get data to write fieldbyteCount - max bytes in fieldIOExceptionpublic static void writeFieldFromDataInput(Pipe pipe, int loc, DataInput dataInput, int byteCount) throws IOException
pipe - to write toloc - location to write fielddataInput - data used to write fieldbyteCount - max bytes in fieldIOExceptionpublic static ByteBuffer[] wrappedUnstructuredLayoutBufferOpen(Pipe<?> target, int loc)
public static ByteBuffer[] wrappedUnstructuredLayoutBufferOpen(Pipe<?> target, int maxLength, int loc)
public static void wrappedUnstructuredLayoutBufferCancel(Pipe<?> target)
public static void wrappedUnstructuredLayoutBufferClose(Pipe<?> target, int loc, int length)
target - pipe to useloc - field to closepublic static <S extends MessageSchema<S>> DataOutputBlobWriter<S> outputStream(Pipe<S> pipe)
pipe - to get output stream fromCopyright © 2018. All Rights Reserved.