private static boolean isNotAlreadyDefined(TrieParser fieldParser, byte[] raw) { long val = -1; boolean ok = -1 == (val=fieldIdLookup(fieldParser, raw, 0, raw.length, Integer.MAX_VALUE)); if (!ok) { System.err.println("Already have text "+new String(raw)+" associated with "+val); } return ok; }
private static boolean isNotAlreadyDefined(TrieParser fieldParser, byte[] raw) { long val = -1; boolean ok = -1 == (val=fieldIdLookup(fieldParser, raw, 0, raw.length, Integer.MAX_VALUE)); if (!ok) { System.err.println("Already have text "+new String(raw)+" associated with "+val); } return ok; }
private static boolean isNotAlreadyDefined(TrieParser fieldParser, byte[] raw) { long val = -1; boolean ok = -1 == (val=fieldIdLookup(fieldParser, raw, 0, raw.length, Integer.MAX_VALUE)); if (!ok) { System.err.println("Already have text "+new String(raw)+" associated with "+val); } return ok; }
public long modifyStruct(int structId, byte[] fieldName, int fieldPos, int fieldLen, StructType fieldType, int fieldDim) { assert((IS_STRUCT_BIT&structId)!=0) : "must be valid struct"; int idx = STRUCT_MASK & structId; long fieldIdx = fieldIdLookup(this.fields[idx], fieldName, fieldPos, fieldLen, Integer.MAX_VALUE); if (-1 == fieldIdx) { //only creating copy here because we know it will be held for the run. fieldIdx = growStruct(structId, fieldType, fieldDim, Arrays.copyOfRange(fieldName,fieldPos,fieldLen)); } else { ////////// //modify an existing field, we have new data to apply ////////// //use the newest defined type this.fieldTypes[idx][ FIELD_MASK&(int)fieldIdx] = fieldType; //keep largest dim value this.fieldDims[idx][ FIELD_MASK&(int)fieldIdx] = Math.max(this.fieldDims[idx][FIELD_MASK&(int)fieldIdx], fieldDim); } //System.out.println("modify struct "+fieldIdx+" "+Appendables.appendUTF8(new StringBuilder(), fieldName, fieldPos, fieldLen, Integer.MAX_VALUE)); return fieldIdx; }
public long modifyStruct(int structId, byte[] fieldName, int fieldPos, int fieldLen, StructType fieldType, int fieldDim) { assert((IS_STRUCT_BIT&structId)!=0) : "must be valid struct"; int idx = STRUCT_MASK & structId; long fieldIdx = fieldIdLookup(this.fields[idx], fieldName, fieldPos, fieldLen, Integer.MAX_VALUE); if (-1 == fieldIdx) { //only creating copy here because we know it will be held for the run. fieldIdx = growStruct(structId, fieldType, fieldDim, Arrays.copyOfRange(fieldName,fieldPos,fieldLen)); } else { ////////// //modify an existing field, we have new data to apply ////////// //use the newest defined type this.fieldTypes[idx][ FIELD_MASK&(int)fieldIdx] = fieldType; //keep largest dim value this.fieldDims[idx][ FIELD_MASK&(int)fieldIdx] = Math.max(this.fieldDims[idx][FIELD_MASK&(int)fieldIdx], fieldDim); } return fieldIdx; }
public long modifyStruct(int structId, byte[] fieldName, int fieldPos, int fieldLen, StructType fieldType, int fieldDim) { assert((IS_STRUCT_BIT&structId)!=0) : "must be valid struct"; int idx = STRUCT_MASK & structId; long fieldIdx = fieldIdLookup(this.fields[idx], fieldName, fieldPos, fieldLen, Integer.MAX_VALUE); if (-1 == fieldIdx) { //only creating copy here because we know it will be held for the run. fieldIdx = growStruct(structId, fieldType, fieldDim, Arrays.copyOfRange(fieldName,fieldPos,fieldLen)); } else { ////////// //modify an existing field, we have new data to apply ////////// //use the newest defined type this.fieldTypes[idx][ FIELD_MASK&(int)fieldIdx] = fieldType; //keep largest dim value this.fieldDims[idx][ FIELD_MASK&(int)fieldIdx] = Math.max(this.fieldDims[idx][FIELD_MASK&(int)fieldIdx], fieldDim); } //System.out.println("modify struct "+fieldIdx+" "+Appendables.appendUTF8(new StringBuilder(), fieldName, fieldPos, fieldLen, Integer.MAX_VALUE)); return fieldIdx; }