本文整理汇总了Java中org.apache.kylin.common.util.BytesUtil.writeLong方法的典型用法代码示例。如果您正苦于以下问题:Java BytesUtil.writeLong方法的具体用法?Java BytesUtil.writeLong怎么用?Java BytesUtil.writeLong使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.kylin.common.util.BytesUtil
的用法示例。
在下文中一共展示了BytesUtil.writeLong方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: encode
import org.apache.kylin.common.util.BytesUtil; //导入方法依赖的package包/类
@Override
public void encode(String valueStr, byte[] output, int outputOffset) {
if (valueStr == null) {
Arrays.fill(output, outputOffset, outputOffset + fixedLen, NULL);
return;
}
long integer = Long.parseLong(valueStr);
if (integer > CAP[fixedLen] || integer < TAIL[fixedLen]) {
if (avoidVerbose++ % 10000 == 0) {
logger.warn("Expect at most " + fixedLen + " bytes, but got " + valueStr + ", will truncate, hit times:" + avoidVerbose);
}
}
if (integer == TAIL[fixedLen]) {
if (avoidVerbose2++ % 10000 == 0) {
logger.warn("Value " + valueStr + " does not fit into " + fixedLen + " bytes ");
}
}
BytesUtil.writeLong(integer + CAP[fixedLen], output, outputOffset, fixedLen);//apply an offset to preserve binary order, overflow is okay
}
示例2: encode
import org.apache.kylin.common.util.BytesUtil; //导入方法依赖的package包/类
@Override
public void encode(String valueStr, byte[] output, int outputOffset) {
if (valueStr == null) {
Arrays.fill(output, outputOffset, outputOffset + fixedLen, NULL);
return;
}
long integer = Long.parseLong(valueStr);
if (integer > CAP[fixedLen]) {
if (avoidVerbose++ % 10000 == 0) {
logger.warn("Expect at most " + fixedLen + " bytes, but got " + valueStr + ", will truncate, hit times:" + avoidVerbose);
}
}
BytesUtil.writeLong(integer, output, outputOffset, fixedLen);
}
示例3: encode
import org.apache.kylin.common.util.BytesUtil; //导入方法依赖的package包/类
@Override
public void encode(String value, byte[] output, int outputOffset) {
if (value == null) {
Arrays.fill(output, outputOffset, outputOffset + fixedLen, NULL);
return;
}
Integer encodeValue = map.get(value);
if (encodeValue == null) {
throw new IllegalArgumentException("Value '" + value + "' is not a recognized boolean value.");
}
BytesUtil.writeLong(encodeValue, output, outputOffset, fixedLen);
}
示例4: encode
import org.apache.kylin.common.util.BytesUtil; //导入方法依赖的package包/类
@Override
public void encode(String value, byte[] output, int outputOffset) {
if (value == null) {
Arrays.fill(output, outputOffset, outputOffset + fixedLen, NULL);
return;
}
long code = codec.valueToCode(value);
BytesUtil.writeLong(code, output, outputOffset, fixedLen);
}
示例5: gt
import org.apache.kylin.common.util.BytesUtil; //导入方法依赖的package包/类
private CompareTupleFilter gt(ColumnTupleFilter col, int v) {
CompareTupleFilter r = new CompareTupleFilter(FilterOperatorEnum.GT);
r.addChild(col);
int c = col.getColumn().getColumnDesc().getZeroBasedIndex();
int len = info.getCodeSystem().maxCodeLength(c);
ByteArray bytes = new ByteArray(len);
BytesUtil.writeLong(v, bytes.array(), bytes.offset(), len);
r.addChild(new ConstantTupleFilter(bytes));
return r;
}
示例6: eq
import org.apache.kylin.common.util.BytesUtil; //导入方法依赖的package包/类
private CompareTupleFilter eq(ColumnTupleFilter col, int... values) {
CompareTupleFilter r = new CompareTupleFilter(FilterOperatorEnum.IN);
r.addChild(col);
List<ByteArray> list = Lists.newArrayList();
for (int v : values) {
int c = col.getColumn().getColumnDesc().getZeroBasedIndex();
int len = info.getCodeSystem().maxCodeLength(c);
ByteArray bytes = new ByteArray(len);
BytesUtil.writeLong(v, bytes.array(), bytes.offset(), len);
list.add(bytes);
}
r.addChild(new ConstantTupleFilter(list));
return r;
}
示例7: serialize
import org.apache.kylin.common.util.BytesUtil; //导入方法依赖的package包/类
@Override
public void serialize(Long value, ByteBuffer out) {
BytesUtil.writeLong(value, out);
}
示例8: serialize
import org.apache.kylin.common.util.BytesUtil; //导入方法依赖的package包/类
@Override
public void serialize(Object code, ByteBuffer buf) {
BytesUtil.writeLong(Long.parseLong(code.toString()), buf);
}
示例9: decode
import org.apache.kylin.common.util.BytesUtil; //导入方法依赖的package包/类
private String decode(long code) {
BytesUtil.writeLong(code, buf, 0, buf.length);
return enc.decode(buf, 0, buf.length);
}