protected MapJSONToPipeBuilder(M schema, Class<K> enums, int msgIdx, int ... bitFields) { this.allEnums = enums.getEnumConstants(); this.msgIdx = msgIdx; this.from = MessageSchema.from(schema); this.bitFields = bitFields; }
public PipeConfig(T messageSchema) { //default size which is smaller than half of 64K because this is the L1 cache size on intel haswell. this.slabBits = 6; this.blobBits = 15; this.byteConst = null; this.schema = messageSchema; //validate FieldReferenceOffsetManager.maxVarLenFieldsPerPrimaryRingSize(MessageSchema.from(messageSchema), 1<<slabBits); }
public PipeConfig(T messageSchema) { //default size which is smaller than half of 64K because this is the L1 cache size on intel haswell. this.slabBits = 6; this.blobBits = 15; this.byteConst = null; this.schema = messageSchema; this.maximumLenghOfVariableLengthFields = -1; //validate FieldReferenceOffsetManager.maxVarLenFieldsPerPrimaryRingSize(MessageSchema.from(messageSchema), 1<<slabBits); }
private void validate(T messageSchema, int minimumFragmentsOnRing, int maximumLenghOfVariableLengthFields) { //Do not change this constant, it is assumed by Pipe roll over masks and flags if (blobBits>30) { throw new UnsupportedOperationException("Unable to support blob data larger than 1GB Reduce either the data size or count of desired message msgs:"+ minimumFragmentsOnRing+" varLen:"+maximumLenghOfVariableLengthFields+" schema: "+messageSchema+ " slabBits: "+slabBits+" maxFragSize: "+FieldReferenceOffsetManager.maxFragmentSize(MessageSchema.from(messageSchema))); } if (slabBits>30) { throw new UnsupportedOperationException("Unable to support slab data larger than 1GB, Reduce the count of desired message msgs:"+ minimumFragmentsOnRing+" varLen:"+maximumLenghOfVariableLengthFields+" schema: "+messageSchema); } }
public void processSchema() throws IOException { final FieldReferenceOffsetManager from = MessageSchema.from(schema); workspacesDefinedCount = 0; super.processSchema(); //place at the end the business methods which are overridden bodyTarget.append('\n').append('\n').append(workspace1); }
public PipeConfig(T messageSchema) { //default size which is smaller than half of 64K because this is the L1 cache size on intel haswell. this.slabBits = 6; this.blobBits = 15; this.byteConst = null; this.schema = messageSchema; this.maximumLenghOfVariableLengthFields = -1; //validate FieldReferenceOffsetManager.maxVarLenFieldsPerPrimaryRingSize(MessageSchema.from(messageSchema), 1<<slabBits); }
public void processSchema() throws IOException { final FieldReferenceOffsetManager from = MessageSchema.from(schema); workspacesDefinedCount = 0; super.processSchema(); //place at the end the business methods which are overridden bodyTarget.append('\n').append('\n').append(workspace1); }
public void processSchema() throws IOException { final FieldReferenceOffsetManager from = MessageSchema.from(schema); workspacesDefinedCount = 0; super.processSchema(); //place at the end the business methods which are overridden bodyTarget.append('\n').append('\n').append(workspace1); }
private void appendMessageIdentifier(int cursor, MessageSchema schema) throws IOException { FieldReferenceOffsetManager from = MessageSchema.from(schema); bodyTarget.append("/*"); appendInternalMethodName(cursor); bodyTarget.append("*/"); if (schema instanceof MessageSchemaDynamic || null==from.fieldNameScript[cursor]) { bodyTarget.append(Integer.toString(cursor)); } else { bodyTarget.append(schema.getClass().getSimpleName()).append("."); bodyTarget.append(FieldReferenceOffsetManager.buildMsgConstName(from, cursor)); } }
private void appendMessageIdentifier(int cursor, MessageSchema schema) throws IOException { FieldReferenceOffsetManager from = MessageSchema.from(schema); bodyTarget.append("/*"); appendInternalMethodName(cursor); bodyTarget.append("*/"); if (schema instanceof MessageSchemaDynamic || null==from.fieldNameScript[cursor]) { bodyTarget.append(Integer.toString(cursor)); } else { bodyTarget.append(schema.getClass().getSimpleName()).append("."); bodyTarget.append(FieldReferenceOffsetManager.buildMsgConstName(from, cursor)); } }
public PipeConfig(T messageSchema, int minimumFragmentsOnRing, int maximumLenghOfVariableLengthFields, byte[] byteConst) { this.maximumLenghOfVariableLengthFields = maximumLenghOfVariableLengthFields; int biggestFragment = FieldReferenceOffsetManager.maxFragmentSize(MessageSchema.from(messageSchema)); int primaryMinSize = minimumFragmentsOnRing * biggestFragment; this.slabBits = (byte)(32 - Integer.numberOfLeadingZeros(primaryMinSize - 1)); int maxVarFieldsInRingAtOnce = FieldReferenceOffsetManager.maxVarLenFieldsPerPrimaryRingSize(MessageSchema.from(messageSchema), 1<<slabBits); int secondaryMinSize = maxVarFieldsInRingAtOnce * maximumLenghOfVariableLengthFields; this.blobBits = ((0==maximumLenghOfVariableLengthFields) | (0==maxVarFieldsInRingAtOnce))? (byte)0 : (byte)(32 - Integer.numberOfLeadingZeros(secondaryMinSize - 1)); this.byteConst = byteConst; this.schema = messageSchema; validate(messageSchema, minimumFragmentsOnRing, maximumLenghOfVariableLengthFields ); }
public PipeConfig(T messageSchema, int minimumFragmentsOnRing, int maximumLenghOfVariableLengthFields, byte[] byteConst) { int biggestFragment = FieldReferenceOffsetManager.maxFragmentSize(MessageSchema.from(messageSchema)); int primaryMinSize = minimumFragmentsOnRing*biggestFragment; this.slabBits = (byte)(32 - Integer.numberOfLeadingZeros(primaryMinSize - 1)); int maxVarFieldsInRingAtOnce = FieldReferenceOffsetManager.maxVarLenFieldsPerPrimaryRingSize(MessageSchema.from(messageSchema), 1<<slabBits); int secondaryMinSize = maxVarFieldsInRingAtOnce * maximumLenghOfVariableLengthFields; this.blobBits = ((0==maximumLenghOfVariableLengthFields) | (0==maxVarFieldsInRingAtOnce))? (byte)0 : (byte)(32 - Integer.numberOfLeadingZeros(secondaryMinSize - 1)); this.byteConst = byteConst; this.schema = messageSchema; validate(messageSchema, minimumFragmentsOnRing, maximumLenghOfVariableLengthFields ); }
protected void defineMembers() throws IOException { final FieldReferenceOffsetManager from = MessageSchema.from(schema); if (!from.hasSimpleMessagesOnly) { bodyTarget.append("private ").append(LowLevelStateManager.class.getSimpleName()).append(" navState;\n"); } if (buildFullStageWritingToPipe()) { appendClass(bodyTarget.append("private "), pipeClass, schema.getClass()).append(pipeVarName).append(";\n"); } additionalMembers(bodyTarget); from.appendConstuctionSource(bodyTarget); }
protected void defineMembers() throws IOException { final FieldReferenceOffsetManager from = MessageSchema.from(schema); if (!from.hasSimpleMessagesOnly) { bodyTarget.append("private ").append(LowLevelStateManager.class.getSimpleName()).append(" navState;\n"); } if (buildFullStageWritingToPipe()) { appendClass(bodyTarget.append("private "), pipeClass, schema.getClass()).append(pipeVarName).append(";\n"); } additionalMembers(bodyTarget); from.appendConstuctionSource(bodyTarget); }
@Override protected void processIntegerUnsignedOptional(String name, int i, int fieldCursor, long id) throws IOException { int nullLiteral = FieldReferenceOffsetManager.getAbsent32Value(MessageSchema.from(schema)); //build the argument for calling, this will be modified for specific business logic. appendArgumentForBusinessCall(name, "null", "Integer", fieldCursor); //build arg list for method signature appendTypeSignatureForPipeWriter(name, "Integer"); // Pipe.addIntValue(null==source? nullLiteral : source, output); //build the line to add value into the the pipe, this will not be modified. appendWirteOptionalToPipe(name, nullLiteral, "addIntValue"); firstField = false; }
@Override protected void processLongUnsignedOptional(String name, int idx, int fieldCursor, long id) throws IOException { long nullLiteral = FieldReferenceOffsetManager.getAbsent64Value(MessageSchema.from(schema)); //build the argument for calling, this will be modified for specific business logic. appendArgumentForBusinessCall(name, "null", "Long", fieldCursor); //build arg list for method signature appendTypeSignatureForPipeWriter(name, "Long"); // Pipe.addIntValue(null==source? nullLiteral : source, output); //build the line to add value into the the pipe, this will not be modified. appendWirteOptionalToPipe(name, nullLiteral, "addLongValue"); firstField = false; }
@Override protected void processLongUnsignedOptional(String name, int idx, int fieldCursor, long id) throws IOException { long nullLiteral = FieldReferenceOffsetManager.getAbsent64Value(MessageSchema.from(schema)); //build the argument for calling, this will be modified for specific business logic. appendArgumentForBusinessCall(name, "null", "Long", fieldCursor); //build arg list for method signature appendTypeSignatureForPipeWriter(name, "Long"); // Pipe.addIntValue(null==source? nullLiteral : source, output); //build the line to add value into the the pipe, this will not be modified. appendWirteOptionalToPipe(name, nullLiteral, "addLongValue"); firstField = false; }
@Override protected void processIntegerUnsignedOptional(String name, int i, int fieldCursor, long id) throws IOException { int nullLiteral = FieldReferenceOffsetManager.getAbsent32Value(MessageSchema.from(schema)); //build the argument for calling, this will be modified for specific business logic. appendArgumentForBusinessCall(name, "null", "Integer", fieldCursor); //build arg list for method signature appendTypeSignatureForPipeWriter(name, "Integer"); // Pipe.addIntValue(null==source? nullLiteral : source, output); //build the line to add value into the the pipe, this will not be modified. appendWirteOptionalToPipe(name, nullLiteral, "addIntValue"); firstField = false; }
@Override protected void processIntegerSignedOptional(String name, int i, int fieldCursor, long id) throws IOException { int nullLiteral = FieldReferenceOffsetManager.getAbsent32Value(MessageSchema.from(schema)); //build the argument for calling, this will be modified for specific business logic. appendArgumentForBusinessCall(name, "null", "Integer", fieldCursor); //build arg list for method signature appendTypeSignatureForPipeWriter(name, "Integer"); // Pipe.addIntValue(null==source? nullLiteral : source, output); //build the line to add value into the the pipe, this will not be modified. appendWirteOptionalToPipe(name, nullLiteral, "addIntValue"); firstField = false; }
@Override protected void processLongSignedOptional(String name, int idx, int fieldCursor, long id) throws IOException { long nullLiteral = FieldReferenceOffsetManager.getAbsent64Value(MessageSchema.from(schema)); //build the argument for calling, this will be modified for specific business logic. appendArgumentForBusinessCall(name, "null", "Long", fieldCursor); //build arg list for method signature appendTypeSignatureForPipeWriter(name, "Long"); // Pipe.addIntValue(null==source? nullLiteral : source, output); //build the line to add value into the the pipe, this will not be modified. appendWirteOptionalToPipe(name, nullLiteral, "addLongValue"); firstField = false; }