org.apache.hadoop.hbase.client.Get.getAttributesMap()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(9.5k)|赞(0)|评价(0)|浏览(123)

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

Get.getAttributesMap介绍

暂无

代码示例

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

@Test
public void testGetAttributes() {
 Get get = new Get(ROW);
 Assert.assertTrue(get.getAttributesMap().isEmpty());
 Assert.assertNull(get.getAttribute("absent"));
 Assert.assertTrue(get.getAttributesMap().isEmpty());
 Assert.assertNull(get.getAttribute("absent"));
 Assert.assertEquals(1, get.getAttributesMap().size());
 Assert.assertTrue(Arrays.equals(Bytes.toBytes("value1"), get.getAttributesMap().get("attribute1")));
 Assert.assertEquals(1, get.getAttributesMap().size());
 Assert.assertTrue(Arrays.equals(Bytes.toBytes("value12"), get.getAttributesMap().get("attribute1")));
 Assert.assertEquals(2, get.getAttributesMap().size());
 Assert.assertTrue(Arrays.equals(Bytes.toBytes("value2"), get.getAttributesMap().get("attribute2")));
 Assert.assertEquals(1, get.getAttributesMap().size());
 Assert.assertNull(get.getAttributesMap().get("attribute2"));
 Assert.assertEquals(1, get.getAttributesMap().size());
 Assert.assertNull(get.getAttributesMap().get("attribute2"));
 Assert.assertTrue(get.getAttributesMap().isEmpty());
 Assert.assertNull(get.getAttributesMap().get("attribute1"));

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

@Test
public void testAttributesSerialization() throws IOException {
 Get get = new Get(Bytes.toBytes("row"));
 get.setAttribute("attribute1", Bytes.toBytes("value1"));
 get.setAttribute("attribute2", Bytes.toBytes("value2"));
 get.setAttribute("attribute3", Bytes.toBytes("value3"));
 ClientProtos.Get getProto = ProtobufUtil.toGet(get);
 Get get2 = ProtobufUtil.toGet(getProto);
 Assert.assertNull(get2.getAttribute("absent"));
 Assert.assertTrue(Arrays.equals(Bytes.toBytes("value1"), get2.getAttribute("attribute1")));
 Assert.assertTrue(Arrays.equals(Bytes.toBytes("value2"), get2.getAttribute("attribute2")));
 Assert.assertTrue(Arrays.equals(Bytes.toBytes("value3"), get2.getAttribute("attribute3")));
 Assert.assertEquals(3, get2.getAttributesMap().size());
}

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

for (Map.Entry<String, byte[]> attr : get.getAttributesMap().entrySet()) {
 setAttribute(attr.getKey(), attr.getValue());

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

this.setIsolationLevel(get.getIsolationLevel());
this.loadColumnFamiliesOnDemand = get.getLoadColumnFamiliesOnDemandValue();
for (Map.Entry<String, byte[]> attr : get.getAttributesMap().entrySet()) {
 setAttribute(attr.getKey(), attr.getValue());

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

out.setMaxVersions(in.getMaxVersions());
for (Map.Entry<String, byte[]> attribute : in.getAttributesMap().entrySet()) {
 out.putToAttributes(ByteBuffer.wrap(Bytes.toBytes(attribute.getKey())),
   ByteBuffer.wrap(attribute.getValue()));

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

);
builder.setTimeRange(toTimeRange(get.getTimeRange()));
Map<String, byte[]> attributes = get.getAttributesMap();
if (!attributes.isEmpty()) {
 NameBytesPair.Builder attributeBuilder = NameBytesPair.newBuilder();

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

});
builder.setTimeRange(ProtobufUtil.toTimeRange(get.getTimeRange()));
Map<String, byte[]> attributes = get.getAttributesMap();
if (!attributes.isEmpty()) {
 NameBytesPair.Builder attributeBuilder = NameBytesPair.newBuilder();

代码示例来源:origin: org.apache.hbase/hbase-client

@Test
public void testAttributesSerialization() throws IOException {
 Get get = new Get(Bytes.toBytes("row"));
 get.setAttribute("attribute1", Bytes.toBytes("value1"));
 get.setAttribute("attribute2", Bytes.toBytes("value2"));
 get.setAttribute("attribute3", Bytes.toBytes("value3"));
 ClientProtos.Get getProto = ProtobufUtil.toGet(get);
 Get get2 = ProtobufUtil.toGet(getProto);
 Assert.assertNull(get2.getAttribute("absent"));
 Assert.assertTrue(Arrays.equals(Bytes.toBytes("value1"), get2.getAttribute("attribute1")));
 Assert.assertTrue(Arrays.equals(Bytes.toBytes("value2"), get2.getAttribute("attribute2")));
 Assert.assertTrue(Arrays.equals(Bytes.toBytes("value3"), get2.getAttribute("attribute3")));
 Assert.assertEquals(3, get2.getAttributesMap().size());
}

代码示例来源:origin: org.apache.hbase/hbase-client

for (Map.Entry<String, byte[]> attr : get.getAttributesMap().entrySet()) {
 setAttribute(attr.getKey(), attr.getValue());

代码示例来源:origin: org.apache.hbase/hbase-client

@Test
public void testGetAttributes() {
 Get get = new Get(ROW);
 Assert.assertTrue(get.getAttributesMap().isEmpty());
 Assert.assertNull(get.getAttribute("absent"));
 Assert.assertTrue(get.getAttributesMap().isEmpty());
 Assert.assertNull(get.getAttribute("absent"));
 Assert.assertEquals(1, get.getAttributesMap().size());
 Assert.assertTrue(Arrays.equals(Bytes.toBytes("value1"), get.getAttributesMap().get("attribute1")));
 Assert.assertEquals(1, get.getAttributesMap().size());
 Assert.assertTrue(Arrays.equals(Bytes.toBytes("value12"), get.getAttributesMap().get("attribute1")));
 Assert.assertEquals(2, get.getAttributesMap().size());
 Assert.assertTrue(Arrays.equals(Bytes.toBytes("value2"), get.getAttributesMap().get("attribute2")));
 Assert.assertEquals(1, get.getAttributesMap().size());
 Assert.assertNull(get.getAttributesMap().get("attribute2"));
 Assert.assertEquals(1, get.getAttributesMap().size());
 Assert.assertNull(get.getAttributesMap().get("attribute2"));
 Assert.assertTrue(get.getAttributesMap().isEmpty());
 Assert.assertNull(get.getAttributesMap().get("attribute1"));

代码示例来源:origin: org.apache.hbase/hbase-client

this.setIsolationLevel(get.getIsolationLevel());
this.loadColumnFamiliesOnDemand = get.getLoadColumnFamiliesOnDemandValue();
for (Map.Entry<String, byte[]> attr : get.getAttributesMap().entrySet()) {
 setAttribute(attr.getKey(), attr.getValue());

代码示例来源:origin: org.apache.hbase/hbase-client

);
builder.setTimeRange(toTimeRange(get.getTimeRange()));
Map<String, byte[]> attributes = get.getAttributesMap();
if (!attributes.isEmpty()) {
 NameBytesPair.Builder attributeBuilder = NameBytesPair.newBuilder();

代码示例来源:origin: org.apache.hbase/hbase-client

});
builder.setTimeRange(ProtobufUtil.toTimeRange(get.getTimeRange()));
Map<String, byte[]> attributes = get.getAttributesMap();
if (!attributes.isEmpty()) {
 NameBytesPair.Builder attributeBuilder = NameBytesPair.newBuilder();

代码示例来源:origin: harbby/presto-connectors

/**
 * Builds a scan object with the same specs as get.
 * @param get get to model scan after
 */
public Scan(Get get) {
 this.startRow = get.getRow();
 this.stopRow = get.getRow();
 this.filter = get.getFilter();
 this.cacheBlocks = get.getCacheBlocks();
 this.maxVersions = get.getMaxVersions();
 this.storeLimit = get.getMaxResultsPerColumnFamily();
 this.storeOffset = get.getRowOffsetPerColumnFamily();
 this.tr = get.getTimeRange();
 this.familyMap = get.getFamilyMap();
 this.getScan = true;
 this.consistency = get.getConsistency();
 this.setIsolationLevel(get.getIsolationLevel());
 for (Map.Entry<String, byte[]> attr : get.getAttributesMap().entrySet()) {
  setAttribute(attr.getKey(), attr.getValue());
 }
 for (Map.Entry<byte[], TimeRange> entry : get.getColumnFamilyTimeRange().entrySet()) {
  TimeRange tr = entry.getValue();
  setColumnFamilyTimeRange(entry.getKey(), tr.getMin(), tr.getMax());
 }
}

代码示例来源:origin: harbby/presto-connectors

for (Map.Entry<String, byte[]> attr : get.getAttributesMap().entrySet()) {
 setAttribute(attr.getKey(), attr.getValue());

代码示例来源:origin: com.aliyun.hbase/alihbase-client

for (Map.Entry<String, byte[]> attr : get.getAttributesMap().entrySet()) {
 setAttribute(attr.getKey(), attr.getValue());

代码示例来源:origin: com.aliyun.hbase/alihbase-client

/**
 * Builds a scan object with the same specs as get.
 * @param get get to model scan after
 */
public Scan(Get get) {
 this.startRow = get.getRow();
 this.includeStartRow = true;
 this.stopRow = get.getRow();
 this.includeStopRow = true;
 this.filter = get.getFilter();
 this.cacheBlocks = get.getCacheBlocks();
 this.maxVersions = get.getMaxVersions();
 this.storeLimit = get.getMaxResultsPerColumnFamily();
 this.storeOffset = get.getRowOffsetPerColumnFamily();
 this.tr = get.getTimeRange();
 this.familyMap = get.getFamilyMap();
 this.asyncPrefetch = false;
 this.consistency = get.getConsistency();
 this.setIsolationLevel(get.getIsolationLevel());
 this.loadColumnFamiliesOnDemand = get.getLoadColumnFamiliesOnDemandValue();
 for (Map.Entry<String, byte[]> attr : get.getAttributesMap().entrySet()) {
  setAttribute(attr.getKey(), attr.getValue());
 }
 for (Map.Entry<byte[], TimeRange> entry : get.getColumnFamilyTimeRange().entrySet()) {
  TimeRange tr = entry.getValue();
  setColumnFamilyTimeRange(entry.getKey(), tr.getMin(), tr.getMax());
 }
 this.mvccReadPoint = -1L;
 setPriority(get.getPriority());
}

代码示例来源:origin: com.aliyun.hbase/alihbase-client

});
builder.setTimeRange(ProtobufUtil.toTimeRange(get.getTimeRange()));
Map<String, byte[]> attributes = get.getAttributesMap();
if (!attributes.isEmpty()) {
 NameBytesPair.Builder attributeBuilder = NameBytesPair.newBuilder();

代码示例来源:origin: harbby/presto-connectors

builder.setTimeRange(timeRangeBuilder.build());
Map<String, byte[]> attributes = get.getAttributesMap();
if (!attributes.isEmpty()) {
 NameBytesPair.Builder attributeBuilder = NameBytesPair.newBuilder();

代码示例来源:origin: com.aliyun.hbase/alihbase-client

);
builder.setTimeRange(toTimeRange(get.getTimeRange()));
Map<String, byte[]> attributes = get.getAttributesMap();
if (!attributes.isEmpty()) {
 NameBytesPair.Builder attributeBuilder = NameBytesPair.newBuilder();

相关文章