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

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

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

Get.setAttribute介绍

暂无

代码示例

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

private int getCount(Table t, byte[] type) throws IOException {
 Get test = new Get(row);
 test.setAttribute("count", new byte[] {});
 Result res = t.get(test);
 return Bytes.toInt(res.getValue(count, type));
}

代码示例来源: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

@Test
public void testReadFromCorruptMobFilesWithReadEmptyValueOnMobCellMiss() throws Exception {
 final TableName tableName = TableName.valueOf(name.getMethodName());
 setUp(0, tableName);
 createRecordAndCorruptMobFile(tableName, row1, family, qf1, Bytes.toBytes("value1"));
 Get get = new Get(row1);
 get.setAttribute(MobConstants.EMPTY_VALUE_ON_MOBCELL_MISS, Bytes.toBytes(true));
 Result result = table.get(get);
 Cell cell = result.getColumnLatestCell(family, qf1);
 Assert.assertEquals(0, cell.getValueLength());
}

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

setAttribute(attr.getKey(), attr.getValue());

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

get.setAttribute("absent", null);
Assert.assertTrue(get.getAttributesMap().isEmpty());
Assert.assertNull(get.getAttribute("absent"));
get.setAttribute("attribute1", Bytes.toBytes("value1"));
Assert.assertTrue(Arrays.equals(Bytes.toBytes("value1"), get.getAttribute("attribute1")));
Assert.assertEquals(1, get.getAttributesMap().size());
get.setAttribute("attribute1", Bytes.toBytes("value12"));
Assert.assertTrue(Arrays.equals(Bytes.toBytes("value12"), get.getAttribute("attribute1")));
Assert.assertEquals(1, get.getAttributesMap().size());
get.setAttribute("attribute2", Bytes.toBytes("value2"));
Assert.assertTrue(Arrays.equals(Bytes.toBytes("value2"), get.getAttribute("attribute2")));
Assert.assertEquals(2, get.getAttributesMap().size());
get.setAttribute("attribute2", null);
Assert.assertNull(get.getAttribute("attribute2"));
Assert.assertEquals(1, get.getAttributesMap().size());
get.setAttribute("attribute2", null);
Assert.assertNull(get.getAttribute("attribute2"));
Assert.assertEquals(1, get.getAttributesMap().size());
get.setAttribute("attribute1", null);
Assert.assertNull(get.getAttribute("attribute1"));
Assert.assertTrue(get.getAttributesMap().isEmpty());

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

get.setAttribute(MobConstants.MOB_SCAN_RAW, Bytes.toBytes(true));
result = table.get(get);
cell = result.getColumnLatestCell(hcd1.getName(), Bytes.toBytes(qf1));

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

get.setAttribute(attribute.getName(), attribute.getValue().toByteArray());

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

get.setAttribute(attribute.getName(), attribute.getValue().toByteArray());

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

get.setAttribute(attribute.getName(), attribute.getValue().toByteArray());

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

.setRowOffsetPerColumnFamily(5)
.setTimeRange(0, 13)
.setAttribute("att_v0", Bytes.toBytes("att_v0"))
.setColumnFamilyTimeRange(Bytes.toBytes("cf"), 0, 123)
.setReplicaId(3)

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

get.setAttribute(attribute.getName(), attribute.getValue().toByteArray());

代码示例来源: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

setAttribute(attr.getKey(), attr.getValue());

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

get.setAttribute("absent", null);
Assert.assertTrue(get.getAttributesMap().isEmpty());
Assert.assertNull(get.getAttribute("absent"));
get.setAttribute("attribute1", Bytes.toBytes("value1"));
Assert.assertTrue(Arrays.equals(Bytes.toBytes("value1"), get.getAttribute("attribute1")));
Assert.assertEquals(1, get.getAttributesMap().size());
get.setAttribute("attribute1", Bytes.toBytes("value12"));
Assert.assertTrue(Arrays.equals(Bytes.toBytes("value12"), get.getAttribute("attribute1")));
Assert.assertEquals(1, get.getAttributesMap().size());
get.setAttribute("attribute2", Bytes.toBytes("value2"));
Assert.assertTrue(Arrays.equals(Bytes.toBytes("value2"), get.getAttribute("attribute2")));
Assert.assertEquals(2, get.getAttributesMap().size());
get.setAttribute("attribute2", null);
Assert.assertNull(get.getAttribute("attribute2"));
Assert.assertEquals(1, get.getAttributesMap().size());
get.setAttribute("attribute2", null);
Assert.assertNull(get.getAttribute("attribute2"));
Assert.assertEquals(1, get.getAttributesMap().size());
get.setAttribute("attribute1", null);
Assert.assertNull(get.getAttribute("attribute1"));
Assert.assertTrue(get.getAttributesMap().isEmpty());

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

get.setAttribute(attribute.getName(), attribute.getValue().toByteArray());

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

get.setAttribute(attribute.getName(), attribute.getValue().toByteArray());

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

get.setAttribute(attribute.getName(), attribute.getValue().toByteArray());

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

.setRowOffsetPerColumnFamily(5)
.setTimeRange(0, 13)
.setAttribute("att_v0", Bytes.toBytes("att_v0"))
.setColumnFamilyTimeRange(Bytes.toBytes("cf"), 0, 123)
.setReplicaId(3)

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

get.setAttribute(attribute.getName(), attribute.getValue().toByteArray());

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

@Test
public void testReadFromCorruptMobFilesWithReadEmptyValueOnMobCellMiss() throws Exception {
 final TableName tableName = TableName.valueOf(name.getMethodName());
 setUp(0, tableName);
 createRecordAndCorruptMobFile(tableName, row1, family, qf1, Bytes.toBytes("value1"));
 Get get = new Get(row1);
 get.setAttribute(MobConstants.EMPTY_VALUE_ON_MOBCELL_MISS, Bytes.toBytes(true));
 Result result = table.get(get);
 Cell cell = result.getColumnLatestCell(family, qf1);
 Assert.assertEquals(0, cell.getValueLength());
}

相关文章