org.apache.fluo.api.data.Bytes.toArray()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(103)

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

Bytes.toArray介绍

[英]Returns a byte array containing a copy of the bytes
[中]返回包含字节副本的字节数组

代码示例

代码示例来源:origin: apache/fluo

/**
 * @return this
 */
public FluoKeyValueGenerator setValue(Bytes val) {
 this.val = val.toArray();
 return this;
}

代码示例来源:origin: org.apache.fluo/fluo-mapreduce

/**
 * @return this
 */
public FluoKeyValueGenerator setRow(Bytes row) {
 this.row = row.toArray();
 return this;
}

代码示例来源:origin: apache/fluo

/**
 * @return this
 */
public FluoKeyValueGenerator setRow(Bytes row) {
 this.row = row.toArray();
 return this;
}

代码示例来源:origin: org.apache.fluo/fluo-mapreduce

/**
 * @return this
 */
public FluoKeyValueGenerator setValue(Bytes val) {
 this.val = val.toArray();
 return this;
}

代码示例来源:origin: org.apache.fluo/fluo-core

/**
 * Convert from Bytes to Hadoop Text object
 */
public static Text toText(Bytes b) {
 return new Text(b.toArray());
}

代码示例来源:origin: apache/fluo

/**
 * Convert from Bytes to Hadoop Text object
 */
public static Text toText(Bytes b) {
 return new Text(b.toArray());
}

代码示例来源:origin: org.apache.fluo/fluo-api

public void writeTo(OutputStream out) throws IOException {
 // since Bytes is immutable, its important that we do not let the internal byte array escape
 if (length <= 32) {
  int end = offset + length;
  for (int i = offset; i < end; i++) {
   out.write(data[i]);
  }
 } else {
  out.write(toArray());
 }
}

代码示例来源:origin: apache/fluo

/**
 * Convert from Bytes to ByteSequence
 */
public static ByteSequence toByteSequence(Bytes b) {
 return new ArrayByteSequence(b.toArray());
}

代码示例来源:origin: org.apache.fluo/fluo-core

/**
 * Convert from Bytes to ByteSequence
 */
public static ByteSequence toByteSequence(Bytes b) {
 return new ArrayByteSequence(b.toArray());
}

代码示例来源:origin: org.apache.rya/rya.pcj.fluo.app

/**
 * convert a non-utf8 to string and show unprintable bytes as {xx} where x
 * is hex.
 *
 * @param value
 * @return
 */
static String to_String(final Bytes bytes) {
  return to_String(bytes.toArray());
}

代码示例来源:origin: apache/fluo

JsonObservedColumn(Column col, NotificationType nt) {
 this.fam = col.getFamily().toArray();
 this.qual = col.getQualifier().toArray();
 this.vis = col.getVisibility().toArray();
 this.notificationType = nt.name();
}

代码示例来源:origin: org.apache.fluo/fluo-core

JsonObservedColumn(Column col, NotificationType nt) {
 this.fam = col.getFamily().toArray();
 this.qual = col.getQualifier().toArray();
 this.vis = col.getVisibility().toArray();
 this.notificationType = nt.name();
}

代码示例来源:origin: org.apache.fluo/fluo-recipes-core

/**
 * This method is expected to be called before Fluo is initialized to register transient ranges.
 *
 */
public void addTransientRange(String id, RowRange range) {
 String start = DatatypeConverter.printHexBinary(range.getStart().toArray());
 String end = DatatypeConverter.printHexBinary(range.getEnd().toArray());
 appConfig.setProperty(PREFIX + id, start + ":" + end);
}

代码示例来源:origin: apache/fluo

public ReadLockValue(byte[] enc) {
 List<Bytes> fields = ByteArrayUtil.split(enc);
 if (fields.size() != 5) {
  throw new IllegalArgumentException("more fields than expected");
 }
 this.prow = fields.get(0);
 this.pcol = new Column(fields.get(1), fields.get(2), fields.get(3));
 this.transactor = ByteArrayUtil.decodeLong(fields.get(4).toArray());
}

代码示例来源:origin: org.apache.fluo/fluo-recipes-core

public ByteBuffer toByteBuffer() {
 if (getBytes() == null) {
  return null;
 }
 return ByteBuffer.wrap(getBytes().toArray());
}

代码示例来源:origin: apache/incubator-rya

private static String genHash(Bytes row) {
    int hash = Hashing.murmur3_32().hashBytes(row.toArray()).asInt();
    hash = hash & 0x7fffffff;
    // base 36 gives a lot more bins in 4 bytes than hex, but it is still human readable which is
    // nice for debugging.
    String hashString = Strings.padStart(Integer.toString(hash, Character.MAX_RADIX), HASH_LEN, '0');
    hashString = hashString.substring(hashString.length() - HASH_LEN);
    return hashString;
  }
}

代码示例来源:origin: org.apache.fluo/fluo-recipes-core

public byte[] toBytes(byte[] defaultValue) {
 if (getBytes() == null) {
  return defaultValue;
 }
 return getBytes().toArray();
}

代码示例来源:origin: org.apache.fluo/fluo-recipes-core

public byte[] toBytes() {
 if (getBytes() == null) {
  return null;
 }
 return getBytes().toArray();
}

代码示例来源:origin: org.apache.fluo/fluo-recipes-accumulo

public static void compactTransient(FluoConfiguration fluoConfig, RowRange tRange)
   throws Exception {
  Connector conn = getConnector(fluoConfig);
  conn.tableOperations().compact(fluoConfig.getAccumuloTable(),
    new Text(tRange.getStart().toArray()), new Text(tRange.getEnd().toArray()), true, true);
 }
}

代码示例来源:origin: org.apache.fluo/fluo-core

public static void put(Environment env, Mutation m, Column col, long ts, byte[] val) {
  ColumnVisibility cv;
  if (env != null) {
   cv = env.getSharedResources().getVisCache().getCV(col.getVisibility());
  } else if (col.getVisibility().length() == 0) {
   cv = VisibilityCache.EMPTY_VIS;
  } else {
   cv = new ColumnVisibility(ByteUtil.toText(col.getVisibility()));
  }

  m.put(col.getFamily().toArray(), col.getQualifier().toArray(), cv, ts, val);
 }
}

相关文章