checkHasCoprocessor(cp.getClassName()); if (cp.getPriority() < 0) { throw new IOException("Priority must be bigger than or equal with zero, current:" + "|" + cp.getClassName() + "|" + Integer.toString(cp.getPriority()) + "|" + kvString.toString(); return setCoprocessorToMap(value);
/** * Returns an array all the {@link HColumnDescriptor} of the column families * of the table. * * @return Array of all the HColumnDescriptors of the current table * * @see #getFamilies() */ @Deprecated @Override public HColumnDescriptor[] getColumnFamilies() { return Stream.of(delegatee.getColumnFamilies()) .map(this::toHColumnDescriptor) .toArray(size -> new HColumnDescriptor[size]); }
/** * Returns the HColumnDescriptor for a specific column family with name as * specified by the parameter column. * @param column Column family name * @return Column descriptor for the passed family name or the family on * passed in column. * @deprecated Use {@link #getColumnFamily(byte[])}. */ @Deprecated public HColumnDescriptor getFamily(final byte[] column) { return toHColumnDescriptor(delegatee.getColumnFamily(column)); }
checkHasCoprocessor(cp.getClassName()); if (cp.getPriority() < 0) { throw new IOException("Priority must be bigger than or equal with zero, current:" + "|" + cp.getClassName() + "|" + Integer.toString(cp.getPriority()) + "|" + kvString.toString(); return setCoprocessorToMap(value);
/** * Add a table coprocessor to this table. The coprocessor type must be * org.apache.hadoop.hbase.coprocessor.RegionObserver or Endpoint. It won't * check if the class can be loaded or not. Whether a coprocessor is * loadable or not will be determined when a region is opened. * * @param specStr The Coprocessor specification all in in one String * @throws IOException * @return the modifyable TD * @deprecated used by HTableDescriptor and admin.rb. * As of release 2.0.0, this will be removed in HBase 3.0.0. */ @Deprecated public ModifyableTableDescriptor setCoprocessorWithSpec(final String specStr) throws IOException { CoprocessorDescriptor cpDesc = toCoprocessorDescriptor(specStr).orElseThrow( () -> new IllegalArgumentException( "Format does not match " + CP_HTD_ATTR_VALUE_PATTERN + ": " + specStr)); checkHasCoprocessor(cpDesc.getClassName()); return setCoprocessorToMap(specStr); }
/** * Compare the contents of the descriptor with another one passed as a parameter. * Checks if the obj passed is an instance of HTableDescriptor, if yes then the * contents of the descriptors are compared. * * @return true if the contents of the the two descriptors exactly match * * @see java.lang.Object#equals(java.lang.Object) */ @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof HTableDescriptor) { return delegatee.equals(((HTableDescriptor) obj).delegatee); } return false; }
/** * Returns all the column family names of the current table. The map of * HTableDescriptor contains mapping of family name to HColumnDescriptors. * This returns all the keys of the family map which represents the column * family names of the table. * * @return Immutable sorted set of the keys of the families. * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 * (<a href="https://issues.apache.org/jira/browse/HBASE-18008">HBASE-18008</a>). * Use {@link #getColumnFamilyNames()}. */ @Deprecated public Set<byte[]> getFamiliesKeys() { return delegatee.getColumnFamilyNames(); }
/** * Returns an array all the {@link HColumnDescriptor} of the column families * of the table. * * @return Array of all the HColumnDescriptors of the current table * * @see #getFamilies() */ @Deprecated @Override public HColumnDescriptor[] getColumnFamilies() { return Stream.of(delegatee.getColumnFamilies()) .map(this::toHColumnDescriptor) .toArray(size -> new HColumnDescriptor[size]); }
@Override public ColumnFamilyDescriptor getColumnFamily(byte[] name) { return delegatee.getColumnFamily(name); }
@Override public Collection<CoprocessorDescriptor> getCoprocessorDescriptors() { return delegatee.getCoprocessorDescriptors(); }
/** * Returns an unmodifiable collection of all the {@link HColumnDescriptor} * of all the column families of the table. * @deprecated Use {@link #getColumnFamilies}. * @return Immutable collection of {@link HColumnDescriptor} of all the * column families. */ @Deprecated public Collection<HColumnDescriptor> getFamilies() { return Stream.of(delegatee.getColumnFamilies()) .map(this::toHColumnDescriptor) .collect(Collectors.toList()); }
public HTableDescriptor(final TableDescriptor desc) { this(new ModifyableTableDescriptor(desc.getTableName(), desc)); }
public static TableDescriptor copy(TableName name, TableDescriptor desc) { return new ModifyableTableDescriptor(name, desc); }
@Override public Set<byte[]> getColumnFamilyNames() { return delegatee.getColumnFamilyNames(); }
public TableDescriptor build() { return new ModifyableTableDescriptor(desc); }
private TableDescriptorBuilder(final TableDescriptor desc) { this.desc = new ModifyableTableDescriptor(desc); }
private TableDescriptorBuilder(final TableName name) { this.desc = new ModifyableTableDescriptor(name); }
public static TableDescriptor copy(TableDescriptor desc) { return new ModifyableTableDescriptor(desc); }
/** * Construct a table descriptor by cloning the descriptor passed as a parameter * but using a different table name. * <p> * Makes a deep copy of the supplied descriptor. * Can make a modifiable descriptor from an ImmutableHTableDescriptor. * @param name Table name. * @param desc The descriptor. */ public HTableDescriptor(final TableName name, final HTableDescriptor desc) { this(new ModifyableTableDescriptor(name, desc)); }
/** * Check if the table has an attached co-processor represented by the name * className * * @param classNameToMatch - Class name of the co-processor * @return true of the table has a co-processor className */ @Override public boolean hasCoprocessor(String classNameToMatch) { return getCoprocessorDescriptors().stream().anyMatch(cp -> cp.getClassName() .equals(classNameToMatch)); }