Codota Logo
com.ociweb.pronghorn.pipe
Code IndexAdd Codota to your IDE (free)

How to use com.ociweb.pronghorn.pipe

Best Java code snippets using com.ociweb.pronghorn.pipe (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Point p =
  • Codota Iconnew Point(x, y)
  • Codota Iconnew Point()
  • Codota IconMouseEvent e;e.getPoint()
  • Smart code suggestions by Codota
}
origin: com.ociweb/pronghorn-pipes

private static void prepWriteFragmentSpecificProcessing(Pipe pipe, final int cursorPosition, FieldReferenceOffsetManager from) {
  
  if (FieldReferenceOffsetManager.isTemplateStart(from, cursorPosition)) {
    prepWriteMessageStart(pipe, cursorPosition, from);
   } else {			
    //this fragment does not start a new message but its start position must be recorded for usage later
    pipe.ringWalker.activeWriteFragmentStack[from.fragDepth[cursorPosition]]=Pipe.workingHeadPosition(pipe);
   }
}
origin: com.ociweb/pronghorn-pipes

/**
 * Check to see if specified pipe has room to write
 * @param pipe to be checked
 * @return <code>true</code> if pipe has room else <code>false</code>
 */
public static boolean hasRoomForWrite(Pipe pipe) {
  assert(Pipe.singleThreadPerPipeWrite(pipe.id));
  assert(pipe!=null);
  assert(Pipe.isInit(pipe));
  assert(pipe.usingHighLevelAPI);
  return StackStateWalker.hasRoomForFragmentOfSizeX(pipe, pipe.ringWalker.nextWorkingHead - (pipe.sizeOfSlabRing - FieldReferenceOffsetManager.maxFragmentSize( Pipe.from(pipe))));
}
origin: com.ociweb/PronghornPipes

public static <T extends MessageSchema<T>> int closeHighLevelField(DataOutputBlobWriter<T> writer, int targetFieldLoc) {
  //this method will also validate the length was in bound and throw unsupported operation if the pipe was not large enough
  //instead of fail fast as soon as one field goes over we wait to the end and only check once.
  int len = length(writer);
  
  //Appendables.appendUTF8(System.err, writer.byteBuffer, writer.startPosition, len, writer.byteMask);
      
  PipeWriter.writeSpecialBytesPosAndLen(writer.backingPipe, targetFieldLoc, len, writer.startPosition);
  writer.backingPipe.closeBlobFieldWrite();
  
  //Appendables.appendUTF8(System.out, writer.getPipe().blobRing, writer.startPosition, len, writer.getPipe().blobMask);
  
  return len;
}
 
origin: com.ociweb/PronghornPipes

public static <S extends MessageSchema<S>> void writeLL(Pipe<S> pipe, int msgIdx, long field1, long field2) {
  assert(FieldReferenceOffsetManager.isValidMsgIdx(Pipe.from(pipe), msgIdx));
  assert(6==Pipe.from(pipe).fragDataSize[msgIdx]) : "This constant does not this fragment size";
  
  int size = Pipe.addMsgIdx(pipe, msgIdx);
  Pipe.addLongValue(field1, pipe);
  Pipe.addLongValue(field2, pipe);
  Pipe.confirmLowLevelWrite(pipe, size);
  Pipe.publishWrites(pipe);        
}
 
origin: com.ociweb/PronghornPipes

private void publishOpenWrite() {
  //log.trace("write block");
  totalBytesWritten = totalBytesWritten + (outputStreamFlyweight.closeLowLevelField());        
  Pipe.confirmLowLevelWrite(pipe, Pipe.sizeOf(pipe, RawDataSchema.MSG_CHUNKEDSTREAM_1));
  Pipe.publishWrites(pipe);
  hasOpenWrite = false;
}
origin: com.ociweb/PronghornPipes

  private void closeEncoder(Pipe<RawDataSchema> workingPipeOut, DataOutputBlobWriter<RawDataSchema> outputStream) {
    DataOutputBlobWriter.closeLowLevelField(outputStream);
    Pipe.confirmLowLevelWrite(workingPipeOut);
    Pipe.publishWrites(workingPipeOut);
  }
}
origin: com.ociweb/PronghornPipes

/**
 * 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));
}
origin: com.ociweb/pronghorn-pipes

public int closeLowLevelField() {
  int len = length();
  Pipe.addAndGetBlobWorkingHeadPosition(p, len);
  Pipe.addBytePosAndLenSpecial(p,startPosition,len);
  p.closeBlobFieldWrite();
  return len;
}
origin: com.ociweb/pronghorn-pipes

public int closeHighLevelField(int targetFieldLoc) {
  //this method will also validate the length was in bound and throw unsupported operation if the pipe was not large enough
  //instead of fail fast as soon as one field goes over we wait to the end and only check once.
  int len = length();
  PipeWriter.writeSpecialBytesPosAndLen(p, targetFieldLoc, len, startPosition);
  p.closeBlobFieldWrite();
  return len;
}

origin: com.ociweb/PronghornPipes

/**
 * Checks pipe to see if message equals expected
 * @param pipe to be checked
 * @param expected used for comparison with message
 * @return <code>true</code> if message == expected, else <code>false</code>
 */
public static boolean peekMsg(Pipe pipe, int expected) {
  assert(Pipe.singleThreadPerPipeRead(pipe.id));
  return StackStateWalker.hasContentToRead(pipe) 
      && (expected == Pipe.readValue(Pipe.slab(pipe),pipe.slabMask,pipe.ringWalker.nextWorkingTail));
}
origin: com.ociweb/PronghornPipes

/**
 * Take optional Long which may be null. Null is defined as specific long value in FROM
 * @param pipe Ping source
 * @return Long value
 */
public static <S extends MessageSchema<S>> Long takeOptionalLong(Pipe<S> pipe) {
  long absent64Value = FieldReferenceOffsetManager.getAbsent64Value(Pipe.from(pipe));
  return takeOptionalLong(pipe, absent64Value);
}
origin: com.ociweb/PronghornPipes

public <S extends MessageSchema<S>> PipeConfig<S> addConfig(int minimumFragmentsOnPipe, int maximumLengthOfVariableLengthFields, Class<S> clazz) {
  
  PipeConfig<S> newConfig = MessageSchema
              .findInstance(clazz)
              .newPipeConfig(minimumFragmentsOnPipe, maximumLengthOfVariableLengthFields);
  
  return addConfig(newConfig);
}
origin: com.ociweb/PronghornPipes

public static <T extends MessageSchema<T>> void setIntBackData(DataOutputBlobWriter<T> writer, int value, int pos) {
  
  assert(value<=writer.position()) : "wrote "+value+" but all the data is only "+writer.position();
  
  assert(pos>=0) : "Can not write beyond the end. Index values must be zero or positive";
  write32(writer.byteBuffer, writer.byteMask, writer.startPosition+Pipe.blobIndexBasePosition(writer.backingPipe)-(4*(pos+1)), value);       
}
origin: com.ociweb/pronghorn-pipes

@Override
public int read(byte[] b) throws IOException {
  if ((byteMask & position) == bytesLimit) {
    return -1;
  }       
  
  int max = bytesRemaining(this);
  int len = b.length>max? max : b.length;      
  Pipe.copyBytesFromToRing(backing, position, byteMask, b, 0, Integer.MAX_VALUE, len);
  position += b.length;
  return b.length;
}

origin: com.ociweb/PronghornPipes

/**
 * Writes blob to specified field in pipe
 * calls selectStruct(id) only after setting all the object fields
 * @param assoc field association showing where to write
 * @return channelWriter
 */
public ChannelWriter writeBlob(Object assoc) {
  assert(DataOutputBlobWriter.getStructType(channelWriter)<=0) :  "call selectStruct(id) only after setting all the object fields.";
  storeAssocAndPosition(assoc);
  return channelWriter;
}
origin: com.ociweb/PronghornPipes

public static <S extends MessageSchema<S>> void writeLII(Pipe<S> pipe, int msgIdx, long field1, int field2, int field3) {
  assert(FieldReferenceOffsetManager.isValidMsgIdx(Pipe.from(pipe), msgIdx));
  assert(6==Pipe.from(pipe).fragDataSize[msgIdx]) : "This constant does not this fragment size";
  
  int size = Pipe.addMsgIdx(pipe, msgIdx);
  Pipe.addLongValue(field1, pipe);
  Pipe.addIntValue(field2, pipe);
  Pipe.addIntValue(field3, pipe);
  Pipe.confirmLowLevelWrite(pipe, size);
  Pipe.publishWrites(pipe);        
}
 
origin: com.ociweb/PronghornPipes

/**
 * Check to see if specified pipe has room to write
 * @param pipe to be checked
 * @return <code>true</code> if pipe has room else <code>false</code>
 */
public static boolean hasRoomForWrite(Pipe pipe) {
  assert(Pipe.singleThreadPerPipeWrite(pipe.id));
  assert(pipe!=null);
  assert(Pipe.isInit(pipe));
  assert(pipe.usingHighLevelAPI);
  return StackStateWalker.hasRoomForFragmentOfSizeX(pipe, pipe.ringWalker.nextWorkingHead - (pipe.sizeOfSlabRing - FieldReferenceOffsetManager.maxFragmentSize( Pipe.from(pipe))));
}
origin: com.ociweb/PronghornPipes

public int closeHighLevelField(int targetFieldLoc) {
  //this method will also validate the length was in bound and throw unsupported operation if the pipe was not large enough
  //instead of fail fast as soon as one field goes over we wait to the end and only check once.
  int len = length();
  PipeWriter.writeSpecialBytesPosAndLen(p, targetFieldLoc, len, startPosition);
  p.closeBlobFieldWrite();
  return len;
}
 
origin: com.ociweb/PronghornPipes

private static void prepWriteFragmentSpecificProcessing(Pipe pipe, final int cursorPosition, FieldReferenceOffsetManager from) {
  
  if (FieldReferenceOffsetManager.isTemplateStart(from, cursorPosition)) {
    prepWriteMessageStart(pipe, cursorPosition, from);
   } else {			
    //this fragment does not start a new message but its start position must be recorded for usage later
    pipe.ringWalker.activeWriteFragmentStack[from.fragDepth[cursorPosition]]=Pipe.workingHeadPosition(pipe);
   }
}
origin: com.ociweb/PronghornPipes

  public static <S extends MessageSchema<S>> void writeI(Pipe<S> pipe, int msgIdx, int field1) {
    assert(FieldReferenceOffsetManager.isValidMsgIdx(Pipe.from(pipe), msgIdx));
    assert(3==Pipe.from(pipe).fragDataSize[msgIdx]) : "This constant does not this fragment size";
    
    int size = Pipe.addMsgIdx(pipe, msgIdx);
    Pipe.addIntValue(field1, pipe);
    Pipe.confirmLowLevelWrite(pipe, size);
    Pipe.publishWrites(pipe);        
  }
}
com.ociweb.pronghorn.pipe

Most used classes

  • ChannelWriter
  • StructuredReader
  • ChannelReader
  • DataInputBlobReader
  • DataOutputBlobWriter
  • PipeReader,
  • PipeWriter,
  • RawDataSchema,
  • FieldReferenceOffsetManager,
  • PipeConfig,
  • IntHashTable,
  • PipeConfigManager,
  • StructuredWriter,
  • TemplateHandler,
  • MessageSchema,
  • MessageSchemaDynamic,
  • PipeMonitor,
  • RingStreams,
  • StreamingReadVisitorToJSON
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now