热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

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

本文整理了Java中org.apache.hadoop.hbase.client.TableDescriptorBuilder.removeColumnFamily()

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

TableDescriptorBuilder.removeColumnFamily介绍

暂无

代码示例

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

@Override
public TableDescriptor get() throws IOException {
TableDescriptor old = getTableDescriptors().get(tableName);
if (!old.hasColumnFamily(columnName)) {
throw new InvalidFamilyOperationException("Family '" + Bytes.toString(columnName)
+ "' does not exist, so it cannot be deleted");
}
if (old.getColumnFamilyCount() == 1) {
throw new InvalidFamilyOperationException("Family '" + Bytes.toString(columnName)
+ "' is the only column family in the table, so it cannot be deleted");
}
return TableDescriptorBuilder.newBuilder(old).removeColumnFamily(columnName).build();
}
}, nonceGroup, nonce);

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

builder.removeColumnFamily(family.getName());
schemaChangeNeeded = true;

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

@Override
public void perform() throws Exception {
TableDescriptor tableDescriptor = admin.getDescriptor(tableName);
ColumnFamilyDescriptor[] columnDescriptors = tableDescriptor.getColumnFamilies();
if (columnDescriptors.length <= (protectedColumns == null ? 1 : protectedColumns.size())) {
return;
}
int index = random.nextInt(columnDescriptors.length);
while(protectedColumns != null &&
protectedColumns.contains(columnDescriptors[index].getNameAsString())) {
index = random.nextInt(columnDescriptors.length);
}
byte[] colDescName = columnDescriptors[index].getName();
LOG.debug("Performing action: Removing " + Bytes.toString(colDescName)+ " from "
+ tableName.getNameAsString());
TableDescriptorBuilder builder = TableDescriptorBuilder.newBuilder(tableDescriptor);
builder.removeColumnFamily(colDescName);
// Don't try the modify if we're stopping
if (context.isStopping()) {
return;
}
admin.modifyTable(builder.build());
}
}

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

private static Region setMobThreshold(Region region, byte[] cfName, long modThreshold) {
ColumnFamilyDescriptor cfd = ColumnFamilyDescriptorBuilder
.newBuilder(region.getTableDescriptor().getColumnFamily(cfName))
.setMobThreshold(modThreshold)
.build();
TableDescriptor td = TableDescriptorBuilder
.newBuilder(region.getTableDescriptor())
.removeColumnFamily(cfName)
.setColumnFamily(cfd)
.build();
((HRegion)region).setTableDescriptor(td);
return region;
}

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

private static HRegion setMobThreshold(HRegion region, byte[] cfName, long modThreshold) {
ColumnFamilyDescriptor cfd = ColumnFamilyDescriptorBuilder
.newBuilder(region.getTableDescriptor().getColumnFamily(cfName))
.setMobThreshold(modThreshold)
.build();
TableDescriptor td = TableDescriptorBuilder
.newBuilder(region.getTableDescriptor())
.removeColumnFamily(cfName)
.setColumnFamily(cfd)
.build();
region.setTableDescriptor(td);
return region;
}

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

TableDescriptor newTd = TableDescriptorBuilder
.newBuilder(td)
.removeColumnFamily(Bytes.toBytes("cf1"))
.modifyColumnFamily(modCf2)
.modifyColumnFamily(modCf3)

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

.setCompactionEnabled(!oldDescriptor.isCompactionEnabled())
.setColumnFamily(ColumnFamilyDescriptorBuilder.of(cf2))
.removeColumnFamily(Bytes.toBytes(cf3))
.setRegionReplication(3)
.build();

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

private void setSharedIndexMaxVersion(PTable table, TableDescriptor tableDescriptor,
TableDescriptorBuilder indexDescriptorBuilder) {
if (table.getColumnFamilies().isEmpty()) {
byte[] familyName = SchemaUtil.getEmptyColumnFamily(table);
ColumnFamilyDescriptorBuilder indexColDescriptorBuilder = ColumnFamilyDescriptorBuilder.newBuilder(indexDescriptorBuilder.build().getColumnFamily(familyName));
ColumnFamilyDescriptor tableColDescriptor = tableDescriptor.getColumnFamily(familyName);
indexColDescriptorBuilder.setMaxVersions(tableColDescriptor.getMaxVersions());
indexColDescriptorBuilder.setValue( Bytes.toBytes(PhoenixTransactionContext.PROPERTY_TTL),tableColDescriptor.getValue(Bytes.toBytes(PhoenixTransactionContext.PROPERTY_TTL)));
indexDescriptorBuilder.removeColumnFamily(familyName);
indexDescriptorBuilder.addColumnFamily(indexColDescriptorBuilder.build());
} else {
for (PColumnFamily family : table.getColumnFamilies()) {
byte[] familyName = family.getName().getBytes();
ColumnFamilyDescriptor indexColDescriptor = indexDescriptorBuilder.build().getColumnFamily(familyName);
if (indexColDescriptor != null) {
ColumnFamilyDescriptor tableColDescriptor = tableDescriptor.getColumnFamily(familyName);
ColumnFamilyDescriptorBuilder indexColDescriptorBuilder = ColumnFamilyDescriptorBuilder.newBuilder(indexColDescriptor);
indexColDescriptorBuilder.setMaxVersions(tableColDescriptor.getMaxVersions());
indexColDescriptorBuilder.setValue( Bytes.toBytes(PhoenixTransactionContext.PROPERTY_TTL),tableColDescriptor.getValue(Bytes.toBytes(PhoenixTransactionContext.PROPERTY_TTL)));
indexDescriptorBuilder.removeColumnFamily(familyName);
indexDescriptorBuilder.addColumnFamily(indexColDescriptorBuilder.build());
}
}
}
}

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

indexColDescriptor.setValue(Bytes.toBytes(PhoenixTransactionContext.PROPERTY_TTL),
tableColDescriptor.getValue(Bytes.toBytes(PhoenixTransactionContext.PROPERTY_TTL)));
indexDescriptorBuilder.removeColumnFamily(indexFamilyName);
indexDescriptorBuilder.setColumnFamily(indexColDescriptor.build());
} else {
indexColDescriptor.setValue(Bytes.toBytes(PhoenixTransactionContext.PROPERTY_TTL),
tableColDescriptor.getValue(Bytes.toBytes(PhoenixTransactionContext.PROPERTY_TTL)));
indexDescriptorBuilder.removeColumnFamily(familyName);
indexDescriptorBuilder.setColumnFamily(indexColDescriptor.build());

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

ColumnFamilyDescriptorBuilder.newBuilder(origIndexDescriptor.getColumnFamily(defaultIndexColFam));
modifyColumnFamilyDescriptor(indexDefaultColDescriptorBuilder, applyPropsToAllIndexesDefaultCF);
newIndexDescriptorBuilder.removeColumnFamily(defaultIndexColFam);
newIndexDescriptorBuilder.setColumnFamily(indexDefaultColDescriptorBuilder.build());
tableAndIndexDescriptorMappings.put(origIndexDescriptor, newIndexDescriptorBuilder.build());
ColumnFamilyDescriptorBuilder.newBuilder(cfd);
modifyColumnFamilyDescriptor(newCfd, applyPropsToAllIndexesDefaultCF);
newViewIndexDescriptorBuilder.removeColumnFamily(cfd.getName());
newViewIndexDescriptorBuilder.setColumnFamily(newCfd.build());

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

modifyColumnFamilyDescriptor(colDescriptorBuilder, familyProps);
colDescriptor = colDescriptorBuilder.build();
newTableDescriptorBuilder.removeColumnFamily(cf);
newTableDescriptorBuilder.setColumnFamily(colDescriptor);

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

desc=TableDescriptorBuilder.newBuilder(desc).removeColumnFamily(cols[0].getName()).addColumnFamily(col).build();

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

TableDescriptor newTd = TableDescriptorBuilder
.newBuilder(td)
.removeColumnFamily(Bytes.toBytes("cf1"))
.modifyColumnFamily(modCf2)
.modifyColumnFamily(modCf3)

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

private void setSharedIndexMaxVersion(PTable table, TableDescriptor tableDescriptor,
TableDescriptorBuilder indexDescriptorBuilder) {
if (table.getColumnFamilies().isEmpty()) {
byte[] familyName = SchemaUtil.getEmptyColumnFamily(table);
ColumnFamilyDescriptorBuilder indexColDescriptorBuilder = ColumnFamilyDescriptorBuilder.newBuilder(indexDescriptorBuilder.build().getColumnFamily(familyName));
ColumnFamilyDescriptor tableColDescriptor = tableDescriptor.getColumnFamily(familyName);
indexColDescriptorBuilder.setMaxVersions(tableColDescriptor.getMaxVersions());
indexColDescriptorBuilder.setValue( Bytes.toBytes(PhoenixTransactionContext.PROPERTY_TTL),tableColDescriptor.getValue(Bytes.toBytes(PhoenixTransactionContext.PROPERTY_TTL)));
indexDescriptorBuilder.removeColumnFamily(familyName);
indexDescriptorBuilder.addColumnFamily(indexColDescriptorBuilder.build());
} else {
for (PColumnFamily family : table.getColumnFamilies()) {
byte[] familyName = family.getName().getBytes();
ColumnFamilyDescriptor indexColDescriptor = indexDescriptorBuilder.build().getColumnFamily(familyName);
if (indexColDescriptor != null) {
ColumnFamilyDescriptor tableColDescriptor = tableDescriptor.getColumnFamily(familyName);
ColumnFamilyDescriptorBuilder indexColDescriptorBuilder = ColumnFamilyDescriptorBuilder.newBuilder(indexColDescriptor);
indexColDescriptorBuilder.setMaxVersions(tableColDescriptor.getMaxVersions());
indexColDescriptorBuilder.setValue( Bytes.toBytes(PhoenixTransactionContext.PROPERTY_TTL),tableColDescriptor.getValue(Bytes.toBytes(PhoenixTransactionContext.PROPERTY_TTL)));
indexDescriptorBuilder.removeColumnFamily(familyName);
indexDescriptorBuilder.addColumnFamily(indexColDescriptorBuilder.build());
}
}
}
}

代码示例来源:origin: com.aliyun.phoenix/ali-phoenix-core

private void setSharedIndexMaxVersion(PTable table, TableDescriptor tableDescriptor,
TableDescriptorBuilder indexDescriptorBuilder) {
if (table.getColumnFamilies().isEmpty()) {
byte[] familyName = SchemaUtil.getEmptyColumnFamily(table);
ColumnFamilyDescriptorBuilder indexColDescriptorBuilder = ColumnFamilyDescriptorBuilder.newBuilder(indexDescriptorBuilder.build().getColumnFamily(familyName));
ColumnFamilyDescriptor tableColDescriptor = tableDescriptor.getColumnFamily(familyName);
indexColDescriptorBuilder.setMaxVersions(tableColDescriptor.getMaxVersions());
indexColDescriptorBuilder.setValue( Bytes.toBytes(PhoenixTransactionContext.PROPERTY_TTL),tableColDescriptor.getValue(Bytes.toBytes(PhoenixTransactionContext.PROPERTY_TTL)));
indexDescriptorBuilder.removeColumnFamily(familyName);
indexDescriptorBuilder.addColumnFamily(indexColDescriptorBuilder.build());
} else {
for (PColumnFamily family : table.getColumnFamilies()) {
byte[] familyName = family.getName().getBytes();
ColumnFamilyDescriptor indexColDescriptor = indexDescriptorBuilder.build().getColumnFamily(familyName);
if (indexColDescriptor != null) {
ColumnFamilyDescriptor tableColDescriptor = tableDescriptor.getColumnFamily(familyName);
ColumnFamilyDescriptorBuilder indexColDescriptorBuilder = ColumnFamilyDescriptorBuilder.newBuilder(indexColDescriptor);
indexColDescriptorBuilder.setMaxVersions(tableColDescriptor.getMaxVersions());
indexColDescriptorBuilder.setValue( Bytes.toBytes(PhoenixTransactionContext.PROPERTY_TTL),tableColDescriptor.getValue(Bytes.toBytes(PhoenixTransactionContext.PROPERTY_TTL)));
indexDescriptorBuilder.removeColumnFamily(familyName);
indexDescriptorBuilder.addColumnFamily(indexColDescriptorBuilder.build());
}
}
}
}

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

@Override
public void perform() throws Exception {
TableDescriptor tableDescriptor = admin.getDescriptor(tableName);
ColumnFamilyDescriptor[] columnDescriptors = tableDescriptor.getColumnFamilies();
if (columnDescriptors.length <= (protectedColumns == null ? 1 : protectedColumns.size())) {
return;
}
int index = random.nextInt(columnDescriptors.length);
while(protectedColumns != null &&
protectedColumns.contains(columnDescriptors[index].getNameAsString())) {
index = random.nextInt(columnDescriptors.length);
}
byte[] colDescName = columnDescriptors[index].getName();
LOG.debug("Performing action: Removing " + Bytes.toString(colDescName)+ " from "
+ tableName.getNameAsString());
TableDescriptorBuilder builder = TableDescriptorBuilder.newBuilder(tableDescriptor);
builder.removeColumnFamily(colDescName);
// Don't try the modify if we're stopping
if (context.isStopping()) {
return;
}
admin.modifyTable(builder.build());
}
}

代码示例来源:origin: com.aliyun.phoenix/ali-phoenix-core

ColumnFamilyDescriptorBuilder.newBuilder(origIndexDescriptor.getColumnFamily(defaultIndexColFam));
modifyColumnFamilyDescriptor(indexDefaultColDescriptorBuilder, applyPropsToAllIndexesDefaultCF);
newIndexDescriptorBuilder.removeColumnFamily(defaultIndexColFam);
newIndexDescriptorBuilder.setColumnFamily(indexDefaultColDescriptorBuilder.build());
tableAndIndexDescriptorMappings.put(origIndexDescriptor, newIndexDescriptorBuilder.build());
ColumnFamilyDescriptorBuilder.newBuilder(cfd);
modifyColumnFamilyDescriptor(newCfd, applyPropsToAllIndexesDefaultCF);
newViewIndexDescriptorBuilder.removeColumnFamily(cfd.getName());
newViewIndexDescriptorBuilder.setColumnFamily(newCfd.build());

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

private static Region setMobThreshold(Region region, byte[] cfName, long modThreshold) {
ColumnFamilyDescriptor cfd = ColumnFamilyDescriptorBuilder
.newBuilder(region.getTableDescriptor().getColumnFamily(cfName))
.setMobThreshold(modThreshold)
.build();
TableDescriptor td = TableDescriptorBuilder
.newBuilder(region.getTableDescriptor())
.removeColumnFamily(cfName)
.setColumnFamily(cfd)
.build();
((HRegion)region).setTableDescriptor(td);
return region;
}

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

private static HRegion setMobThreshold(HRegion region, byte[] cfName, long modThreshold) {
ColumnFamilyDescriptor cfd = ColumnFamilyDescriptorBuilder
.newBuilder(region.getTableDescriptor().getColumnFamily(cfName))
.setMobThreshold(modThreshold)
.build();
TableDescriptor td = TableDescriptorBuilder
.newBuilder(region.getTableDescriptor())
.removeColumnFamily(cfName)
.setColumnFamily(cfd)
.build();
region.setTableDescriptor(td);
return region;
}

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

.setCompactionEnabled(!oldDescriptor.isCompactionEnabled())
.setColumnFamily(ColumnFamilyDescriptorBuilder.of(cf2))
.removeColumnFamily(Bytes.toBytes(cf3))
.setRegionReplication(3)
.build();

推荐阅读
  • 本文详细介绍了Java中org.eclipse.ui.forms.widgets.ExpandableComposite类的addExpansionListener()方法,并提供了多个实际代码示例,帮助开发者更好地理解和使用该方法。这些示例来源于多个知名开源项目,具有很高的参考价值。 ... [详细]
  • Explore a common issue encountered when implementing an OAuth 1.0a API, specifically the inability to encode null objects and how to resolve it. ... [详细]
  • 本文详细介绍了Java中org.w3c.dom.Text类的splitText()方法,通过多个代码示例展示了其实际应用。该方法用于将文本节点在指定位置拆分为两个节点,并保持在文档树中。 ... [详细]
  • 本文详细介绍了 Apache Jena 库中的 Txn.executeWrite 方法,通过多个实际代码示例展示了其在不同场景下的应用,帮助开发者更好地理解和使用该方法。 ... [详细]
  • 深入解析Spring Cloud Ribbon负载均衡机制
    本文详细介绍了Spring Cloud中的Ribbon组件如何实现服务调用的负载均衡。通过分析其工作原理、源码结构及配置方式,帮助读者理解Ribbon在分布式系统中的重要作用。 ... [详细]
  • 本文详细介绍了Java编程语言中的核心概念和常见面试问题,包括集合类、数据结构、线程处理、Java虚拟机(JVM)、HTTP协议以及Git操作等方面的内容。通过深入分析每个主题,帮助读者更好地理解Java的关键特性和最佳实践。 ... [详细]
  • MQTT技术周报:硬件连接与协议解析
    本周开发笔记重点介绍了在新项目中使用MQTT协议进行硬件连接的技术细节,涵盖其特性、原理及实现步骤。 ... [详细]
  • 扫描线三巨头 hdu1928hdu 1255  hdu 1542 [POJ 1151]
    学习链接:http:blog.csdn.netlwt36articledetails48908031学习扫描线主要学习的是一种扫描的思想,后期可以求解很 ... [详细]
  • 本文详细介绍了 com.facebook.drawee.view.SimpleDraweeView 中的 setScaleType 方法,提供了多个实际代码示例,并解释了其在不同场景下的应用。 ... [详细]
  • Java 中 Writer flush()方法,示例 ... [详细]
  • 本文介绍了如何使用 Spring Boot DevTools 实现应用程序在开发过程中自动重启。这一特性显著提高了开发效率,特别是在集成开发环境(IDE)中工作时,能够提供快速的反馈循环。默认情况下,DevTools 会监控类路径上的文件变化,并根据需要触发应用重启。 ... [详细]
  • Java 中的 BigDecimal pow()方法,示例 ... [详细]
  • 主要用了2个类来实现的,话不多说,直接看运行结果,然后在奉上源代码1.Index.javaimportjava.awt.Color;im ... [详细]
  • 本文详细介绍了Akka中的BackoffSupervisor机制,探讨其在处理持久化失败和Actor重启时的应用。通过具体示例,展示了如何配置和使用BackoffSupervisor以实现更细粒度的异常处理。 ... [详细]
  • 探讨一个显示数字的故障计算器,它支持两种操作:将当前数字乘以2或减去1。本文将详细介绍如何用最少的操作次数将初始值X转换为目标值Y。 ... [详细]
author-avatar
一米静心的阳光
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有