本文整理匯總了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);
}