Java Code Examples for org.apache.kylin.common.util.BytesUtil#readAsciiString()

The following examples show how to use org.apache.kylin.common.util.BytesUtil#readAsciiString() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CoprocessorRowType.java    From kylin-on-parquet-v2 with Apache License 2.0 6 votes vote down vote up
@Override
public CoprocessorRowType deserialize(ByteBuffer in) {
    int n = BytesUtil.readVInt(in);
    int bodyOffset = BytesUtil.readVInt(in);
    TblColRef[] cols = new TblColRef[n];
    int[] colSizes = new int[n];
    for (int i = 0; i < n; i++) {
        String tableName = BytesUtil.readAsciiString(in);
        String colName = BytesUtil.readAsciiString(in);
        String datatype = BytesUtil.readAsciiString(in);
        TableDesc table = new TableDesc();
        table.setName(tableName);
        ColumnDesc col = new ColumnDesc();
        col.setTable(table);
        col.setName(colName);
        col.setDatatype(datatype);
        col.init(table);
        cols[i] = col.getRef();

        int colSize = BytesUtil.readVInt(in);
        colSizes[i] = colSize;
    }
    return new CoprocessorRowType(cols, colSizes, bodyOffset);
}
 
Example 2
Source File: CoprocessorRowType.java    From kylin with Apache License 2.0 6 votes vote down vote up
@Override
public CoprocessorRowType deserialize(ByteBuffer in) {
    int n = BytesUtil.readVInt(in);
    int bodyOffset = BytesUtil.readVInt(in);
    TblColRef[] cols = new TblColRef[n];
    int[] colSizes = new int[n];
    for (int i = 0; i < n; i++) {
        String tableName = BytesUtil.readAsciiString(in);
        String colName = BytesUtil.readAsciiString(in);
        String datatype = BytesUtil.readAsciiString(in);
        TableDesc table = new TableDesc();
        table.setName(tableName);
        ColumnDesc col = new ColumnDesc();
        col.setTable(table);
        col.setName(colName);
        col.setDatatype(datatype);
        col.init(table);
        cols[i] = col.getRef();

        int colSize = BytesUtil.readVInt(in);
        colSizes[i] = colSize;
    }
    return new CoprocessorRowType(cols, colSizes, bodyOffset);
}
 
Example 3
Source File: TableRecordInfoDigest.java    From Kylin with Apache License 2.0 6 votes vote down vote up
@Override
public TableRecordInfoDigest deserialize(ByteBuffer in) {
	TableRecordInfoDigest result = new TableRecordInfoDigest();
	result.nColumns = BytesUtil.readVInt(in);
	result.byteFormLen = BytesUtil.readVInt(in);
	result.offsets = BytesUtil.readIntArray(in);
	result.dictMaxIds = BytesUtil.readIntArray(in);
	result.lengths = BytesUtil.readIntArray(in);
	result.isMetric = BytesUtil.readBooleanArray(in);

	result.measureSerializers = new FixedLenMeasureCodec<?>[result.nColumns];
	for (int i = 0; i < result.nColumns; ++i) {
		String typeStr = BytesUtil.readAsciiString(in);
		if (typeStr == null) {
			result.measureSerializers[i] = null;
		} else {
			result.measureSerializers[i] = FixedLenMeasureCodec
					.get(DataType.getInstance(typeStr));
		}
	}

	return result;
}
 
Example 4
Source File: CoprocessorRowType.java    From Kylin with Apache License 2.0 6 votes vote down vote up
@Override
public CoprocessorRowType deserialize(ByteBuffer in) {
    int n = BytesUtil.readVInt(in);
    TblColRef[] cols = new TblColRef[n];
    int[] colSizes = new int[n];
    for (int i = 0; i < n; i++) {
        String tableName = BytesUtil.readAsciiString(in);
        String colName = BytesUtil.readAsciiString(in);
        TableDesc table = new TableDesc();
        table.setName(tableName);
        ColumnDesc col = new ColumnDesc();
        col.setTable(table);
        col.setName(colName);
        cols[i] = new TblColRef(col);

        int colSize = BytesUtil.readVInt(in);
        colSizes[i] = colSize;
    }
    return new CoprocessorRowType(cols, colSizes);
}
 
Example 5
Source File: CompareTupleFilter.java    From Kylin with Apache License 2.0 5 votes vote down vote up
@Override
public void deserialize(byte[] bytes) {
    this.dynamicVariables.clear();
    ByteBuffer buffer = ByteBuffer.wrap(bytes);
    int size = BytesUtil.readVInt(buffer);
    for (int i = 0; i < size; i++) {
        String nameString = BytesUtil.readUTFString(buffer);
        String valueString = BytesUtil.readUTFString(buffer);
        bindVariable(nameString, valueString);
    }
    this.nullString = BytesUtil.readAsciiString(buffer);
}