co.cask.cdap.api.common.Bytes.toByteArrays()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(118)

本文整理了Java中co.cask.cdap.api.common.Bytes.toByteArrays()方法的一些代码示例,展示了Bytes.toByteArrays()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bytes.toByteArrays()方法的具体详情如下:
包路径:co.cask.cdap.api.common.Bytes
类名称:Bytes
方法名:toByteArrays

Bytes.toByteArrays介绍

[英]Returns an array of byte arrays where first and only entry is. column
[中]返回字节数组数组,其中第一个也是唯一一个条目为。column

代码示例

代码示例来源:origin: co.cask.cdap/cdap-api-common

/**
 * Returns an array of byte arrays where first and only entry is.
 * <code>column</code>
 * @param column operand
 * @return An array of byte arrays where first and only entry is
 * <code>column</code>
 */
public static byte [][] toByteArrays(final String column) {
 return toByteArrays(toBytes(column));
}

代码示例来源:origin: cdapio/cdap

/**
 * Returns an array of byte arrays where first and only entry is.
 * <code>column</code>
 * @param column operand
 * @return An array of byte arrays where first and only entry is
 * <code>column</code>
 */
public static byte [][] toByteArrays(final String column) {
 return toByteArrays(toBytes(column));
}

代码示例来源:origin: caskdata/cdap

/**
 * Tests queryTags are not matched.
 */
private void testNoTagMatch(long now) {
 long endTs = now;
 long startTs = now - TimeUnit.MINUTES.toMicros(37);
 String[] queryTags = {"device5", "device2"};
 Iterator<TimeseriesTable.Entry> entryIterator = table.read(ALL_KEY, startTs, endTs, Bytes.toByteArrays(queryTags));
 Assert.assertFalse(entryIterator.hasNext());
}

代码示例来源:origin: caskdata/cdap

/**
 * Tests iterator filter. queryTags will be sorted inside EntryScanner.
 */
private void testFilter(long now) {
 long endTs = now;
 long startTs = now - TimeUnit.MINUTES.toMicros(37);
 String[] queryTags = {"device2", "device1"};
 Iterator<TimeseriesTable.Entry> entryIterator = table.read(ALL_KEY, startTs, endTs, Bytes.toByteArrays(queryTags));
 List<TimeseriesTable.Entry> result = Lists.newArrayList();
 while (entryIterator.hasNext()) {
  TimeseriesTable.Entry entry = entryIterator.next();
  result.add(entry);
 }
 Assert.assertEquals(2, result.size());
}

相关文章