Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id CE07F200CFC for ; Thu, 28 Sep 2017 17:14:25 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id CC7121609ED; Thu, 28 Sep 2017 15:14:25 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 9626C1609C2 for ; Thu, 28 Sep 2017 17:14:24 +0200 (CEST) Received: (qmail 77171 invoked by uid 500); 28 Sep 2017 15:14:13 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 76233 invoked by uid 99); 28 Sep 2017 15:14:12 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Sep 2017 15:14:12 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A1A4BF5BE1; Thu, 28 Sep 2017 15:14:10 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: git-site-role@apache.org To: commits@hbase.apache.org Date: Thu, 28 Sep 2017 15:14:51 -0000 Message-Id: <82169d8b0d0b40d880c34393e2c1ef8b@git.apache.org> In-Reply-To: <0ae50d3876544e89813c25027ef0caaa@git.apache.org> References: <0ae50d3876544e89813c25027ef0caaa@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [43/51] [partial] hbase-site git commit: Published site at . archived-at: Thu, 28 Sep 2017 15:14:26 -0000 http://git-wip-us.apache.org/repos/asf/hbase-site/blob/67deb422/apidocs/src-html/org/apache/hadoop/hbase/HRegionLocation.html ---------------------------------------------------------------------- diff --git a/apidocs/src-html/org/apache/hadoop/hbase/HRegionLocation.html b/apidocs/src-html/org/apache/hadoop/hbase/HRegionLocation.html index 3298628..a7220e3 100644 --- a/apidocs/src-html/org/apache/hadoop/hbase/HRegionLocation.html +++ b/apidocs/src-html/org/apache/hadoop/hbase/HRegionLocation.html @@ -26,106 +26,120 @@ 018 */ 019package org.apache.hadoop.hbase; 020 -021import org.apache.yetus.audience.InterfaceAudience; -022import org.apache.hadoop.hbase.util.Addressing; -023 -024/** -025 * Data structure to hold HRegionInfo and the address for the hosting -026 * HRegionServer. Immutable. Comparable, but we compare the 'location' only: -027 * i.e. the hostname and port, and *not* the regioninfo. This means two -028 * instances are the same if they refer to the same 'location' (the same -029 * hostname and port), though they may be carrying different regions. -030 * -031 * On a big cluster, each client will have thousands of instances of this object, often -032 * 100 000 of them if not million. It's important to keep the object size as small -033 * as possible. -034 * -035 * <br>This interface has been marked InterfaceAudience.Public in 0.96 and 0.98. -036 */ -037@InterfaceAudience.Public -038public class HRegionLocation implements Comparable<HRegionLocation> { -039 private final HRegionInfo regionInfo; -040 private final ServerName serverName; -041 private final long seqNum; -042 -043 public HRegionLocation(HRegionInfo regionInfo, ServerName serverName) { -044 this(regionInfo, serverName, HConstants.NO_SEQNUM); -045 } -046 -047 public HRegionLocation(HRegionInfo regionInfo, ServerName serverName, long seqNum) { -048 this.regionInfo = regionInfo; -049 this.serverName = serverName; -050 this.seqNum = seqNum; -051 } -052 -053 /** -054 * @see java.lang.Object#toString() -055 */ -056 @Override -057 public String toString() { -058 return "region=" + (this.regionInfo == null ? "null" : this.regionInfo.getRegionNameAsString()) -059 + ", hostname=" + this.serverName + ", seqNum=" + seqNum; -060 } -061 -062 /** -063 * @see java.lang.Object#equals(java.lang.Object) -064 */ -065 @Override -066 public boolean equals(Object o) { -067 if (this == o) { -068 return true; -069 } -070 if (o == null) { -071 return false; -072 } -073 if (!(o instanceof HRegionLocation)) { -074 return false; -075 } -076 return this.compareTo((HRegionLocation)o) == 0; -077 } -078 -079 /** -080 * @see java.lang.Object#hashCode() -081 */ -082 @Override -083 public int hashCode() { -084 return this.serverName.hashCode(); -085 } -086 -087 /** @return HRegionInfo */ -088 public HRegionInfo getRegionInfo(){ -089 return regionInfo; -090 } -091 -092 public String getHostname() { -093 return this.serverName.getHostname(); -094 } -095 -096 public int getPort() { -097 return this.serverName.getPort(); -098 } -099 -100 public long getSeqNum() { -101 return seqNum; -102 } -103 -104 /** -105 * @return String made of hostname and port formatted as -106 * per {@link Addressing#createHostAndPortStr(String, int)} -107 */ -108 public String getHostnamePort() { -109 return Addressing.createHostAndPortStr(this.getHostname(), this.getPort()); -110 } -111 -112 public ServerName getServerName() { -113 return serverName; -114 } -115 -116 @Override -117 public int compareTo(HRegionLocation o) { -118 return serverName.compareTo(o.getServerName()); -119 } -120} +021import org.apache.hadoop.hbase.client.ImmutableHRegionInfo; +022import org.apache.hadoop.hbase.client.RegionInfo; +023import org.apache.hadoop.hbase.util.Addressing; +024import org.apache.yetus.audience.InterfaceAudience; +025 +026/** +027 * Data structure to hold RegionInfo and the address for the hosting +028 * HRegionServer. Immutable. Comparable, but we compare the 'location' only: +029 * i.e. the hostname and port, and *not* the regioninfo. This means two +030 * instances are the same if they refer to the same 'location' (the same +031 * hostname and port), though they may be carrying different regions. +032 * +033 * On a big cluster, each client will have thousands of instances of this object, often +034 * 100 000 of them if not million. It's important to keep the object size as small +035 * as possible. +036 * +037 * <br>This interface has been marked InterfaceAudience.Public in 0.96 and 0.98. +038 */ +039@InterfaceAudience.Public +040public class HRegionLocation implements Comparable<HRegionLocation> { +041 private final RegionInfo regionInfo; +042 private final ServerName serverName; +043 private final long seqNum; +044 +045 public HRegionLocation(RegionInfo regionInfo, ServerName serverName) { +046 this(regionInfo, serverName, HConstants.NO_SEQNUM); +047 } +048 +049 public HRegionLocation(RegionInfo regionInfo, ServerName serverName, long seqNum) { +050 this.regionInfo = regionInfo; +051 this.serverName = serverName; +052 this.seqNum = seqNum; +053 } +054 +055 /** +056 * @see java.lang.Object#toString() +057 */ +058 @Override +059 public String toString() { +060 return "region=" + (this.regionInfo == null ? "null" : this.regionInfo.getRegionNameAsString()) +061 + ", hostname=" + this.serverName + ", seqNum=" + seqNum; +062 } +063 +064 /** +065 * @see java.lang.Object#equals(java.lang.Object) +066 */ +067 @Override +068 public boolean equals(Object o) { +069 if (this == o) { +070 return true; +071 } +072 if (o == null) { +073 return false; +074 } +075 if (!(o instanceof HRegionLocation)) { +076 return false; +077 } +078 return this.compareTo((HRegionLocation)o) == 0; +079 } +080 +081 /** +082 * @see java.lang.Object#hashCode() +083 */ +084 @Override +085 public int hashCode() { +086 return this.serverName.hashCode(); +087 } +088 +089 /** +090 * +091 * @return Immutable HRegionInfo +092 * @deprecated Since 2.0.0. Will remove in 3.0.0. Use {@link #getRegion()}} instead. +093 */ +094 @Deprecated +095 public HRegionInfo getRegionInfo(){ +096 return regionInfo == null ? null : new ImmutableHRegionInfo(regionInfo); +097 } +098 +099 /** +100 * @return regionInfo +101 */ +102 public RegionInfo getRegion(){ +103 return regionInfo; +104 } +105 +106 public String getHostname() { +107 return this.serverName.getHostname(); +108 } +109 +110 public int getPort() { +111 return this.serverName.getPort(); +112 } +113 +114 public long getSeqNum() { +115 return seqNum; +116 } +117 +118 /** +119 * @return String made of hostname and port formatted as +120 * per {@link Addressing#createHostAndPortStr(String, int)} +121 */ +122 public String getHostnamePort() { +123 return Addressing.createHostAndPortStr(this.getHostname(), this.getPort()); +124 } +125 +126 public ServerName getServerName() { +127 return serverName; +128 } +129 +130 @Override +131 public int compareTo(HRegionLocation o) { +132 return serverName.compareTo(o.getServerName()); +133 } +134} http://git-wip-us.apache.org/repos/asf/hbase-site/blob/67deb422/apidocs/src-html/org/apache/hadoop/hbase/HTableDescriptor.html ---------------------------------------------------------------------- diff --git a/apidocs/src-html/org/apache/hadoop/hbase/HTableDescriptor.html b/apidocs/src-html/org/apache/hadoop/hbase/HTableDescriptor.html index 5738430..3f18200 100644 --- a/apidocs/src-html/org/apache/hadoop/hbase/HTableDescriptor.html +++ b/apidocs/src-html/org/apache/hadoop/hbase/HTableDescriptor.html @@ -689,206 +689,203 @@ 681 682 /** 683 * Add a table coprocessor to this table. The coprocessor -684 * type must be org.apache.hadoop.hbase.coprocessor.RegionObserver -685 * or Endpoint. -686 * It won't check if the class can be loaded or not. -687 * Whether a coprocessor is loadable or not will be determined when -688 * a region is opened. -689 * @param className Full class name. -690 * @throws IOException -691 */ -692 public HTableDescriptor addCoprocessor(String className) throws IOException { -693 getDelegateeForModification().addCoprocessor(className); -694 return this; -695 } -696 -697 /** -698 * Add a table coprocessor to this table. The coprocessor -699 * type must be org.apache.hadoop.hbase.coprocessor.RegionObserver -700 * or Endpoint. -701 * It won't check if the class can be loaded or not. -702 * Whether a coprocessor is loadable or not will be determined when -703 * a region is opened. -704 * @param jarFilePath Path of the jar file. If it's null, the class will be -705 * loaded from default classloader. -706 * @param className Full class name. -707 * @param priority Priority -708 * @param kvs Arbitrary key-value parameter pairs passed into the coprocessor. -709 * @throws IOException -710 */ -711 public HTableDescriptor addCoprocessor(String className, Path jarFilePath, -712 int priority, final Map<String, String> kvs) -713 throws IOException { -714 getDelegateeForModification().addCoprocessor(className, jarFilePath, priority, kvs); -715 return this; -716 } -717 -718 /** -719 * Add a table coprocessor to this table. The coprocessor -720 * type must be org.apache.hadoop.hbase.coprocessor.RegionObserver -721 * or Endpoint. -722 * It won't check if the class can be loaded or not. -723 * Whether a coprocessor is loadable or not will be determined when -724 * a region is opened. -725 * @param specStr The Coprocessor specification all in in one String formatted so matches -726 * {@link HConstants#CP_HTD_ATTR_VALUE_PATTERN} -727 * @throws IOException -728 */ -729 public HTableDescriptor addCoprocessorWithSpec(final String specStr) throws IOException { -730 getDelegateeForModification().addCoprocessorWithSpec(specStr); -731 return this; -732 } -733 -734 /** -735 * Check if the table has an attached co-processor represented by the name className -736 * -737 * @param classNameToMatch - Class name of the co-processor -738 * @return true of the table has a co-processor className -739 */ -740 @Override -741 public boolean hasCoprocessor(String classNameToMatch) { -742 return delegatee.hasCoprocessor(classNameToMatch); -743 } -744 -745 /** -746 * Return the list of attached co-processor represented by their name className -747 * -748 * @return The list of co-processors classNames -749 */ -750 @Override -751 public List<String> getCoprocessors() { -752 return delegatee.getCoprocessors(); -753 } -754 -755 /** -756 * Remove a coprocessor from those set on the table -757 * @param className Class name of the co-processor -758 */ -759 public void removeCoprocessor(String className) { -760 getDelegateeForModification().removeCoprocessor(className); -761 } -762 -763 public final static String NAMESPACE_FAMILY_INFO = TableDescriptorBuilder.NAMESPACE_FAMILY_INFO; -764 public final static byte[] NAMESPACE_FAMILY_INFO_BYTES = TableDescriptorBuilder.NAMESPACE_FAMILY_INFO_BYTES; -765 public final static byte[] NAMESPACE_COL_DESC_BYTES = TableDescriptorBuilder.NAMESPACE_COL_DESC_BYTES; -766 -767 /** Table descriptor for namespace table */ -768 public static final HTableDescriptor NAMESPACE_TABLEDESC -769 = new HTableDescriptor(TableDescriptorBuilder.NAMESPACE_TABLEDESC); -770 -771 @Deprecated -772 public HTableDescriptor setOwner(User owner) { -773 getDelegateeForModification().setOwner(owner); -774 return this; -775 } -776 -777 // used by admin.rb:alter(table_name,*args) to update owner. -778 @Deprecated -779 public HTableDescriptor setOwnerString(String ownerString) { -780 getDelegateeForModification().setOwnerString(ownerString); -781 return this; -782 } -783 -784 @Override -785 @Deprecated -786 public String getOwnerString() { -787 return delegatee.getOwnerString(); -788 } -789 -790 /** -791 * @return This instance serialized with pb with pb magic prefix -792 * @see #parseFrom(byte[]) -793 */ -794 public byte[] toByteArray() { -795 return TableDescriptorBuilder.toByteArray(delegatee); -796 } -797 -798 /** -799 * @param bytes A pb serialized {@link HTableDescriptor} instance with pb magic prefix -800 * @return An instance of {@link HTableDescriptor} made from <code>bytes</code> -801 * @throws DeserializationException -802 * @throws IOException -803 * @see #toByteArray() -804 */ -805 public static HTableDescriptor parseFrom(final byte [] bytes) -806 throws DeserializationException, IOException { -807 TableDescriptor desc = TableDescriptorBuilder.parseFrom(bytes); -808 if (desc instanceof ModifyableTableDescriptor) { -809 return new HTableDescriptor((ModifyableTableDescriptor) desc); -810 } else { -811 return new HTableDescriptor(desc); -812 } -813 } -814 -815 /** -816 * Getter for accessing the configuration value by key -817 */ -818 public String getConfigurationValue(String key) { -819 return delegatee.getValue(key); -820 } -821 -822 /** -823 * Getter for fetching an unmodifiable map. -824 */ -825 public Map<String, String> getConfiguration() { -826 return delegatee.getValues().entrySet().stream() -827 .collect(Collectors.toMap( -828 e -> Bytes.toString(e.getKey().get(), e.getKey().getOffset(), e.getKey().getLength()), -829 e -> Bytes.toString(e.getValue().get(), e.getValue().getOffset(), e.getValue().getLength()) -830 )); -831 } -832 -833 /** -834 * Setter for storing a configuration setting in map. -835 * @param key Config key. Same as XML config key e.g. hbase.something.or.other. -836 * @param value String value. If null, removes the setting. -837 */ -838 public HTableDescriptor setConfiguration(String key, String value) { -839 getDelegateeForModification().setValue(key, value); -840 return this; -841 } -842 -843 /** -844 * Remove a config setting represented by the key from the map -845 */ -846 public void removeConfiguration(final String key) { -847 getDelegateeForModification().removeValue(Bytes.toBytes(key)); -848 } -849 -850 @Override -851 public Bytes getValue(Bytes key) { -852 return delegatee.getValue(key); -853 } -854 -855 @Override -856 public String getValue(String key) { -857 return delegatee.getValue(key); -858 } -859 -860 @Override -861 public byte[] getValue(byte[] key) { -862 return delegatee.getValue(key); -863 } -864 -865 @Override -866 public Set<byte[]> getColumnFamilyNames() { -867 return delegatee.getColumnFamilyNames(); -868 } -869 -870 @Override -871 public boolean hasColumnFamily(byte[] name) { -872 return delegatee.hasColumnFamily(name); -873 } -874 -875 @Override -876 public ColumnFamilyDescriptor getColumnFamily(byte[] name) { -877 return delegatee.getColumnFamily(name); -878 } -879 -880 protected ModifyableTableDescriptor getDelegateeForModification() { -881 return delegatee; -882 } -883} +684 * type must be org.apache.hadoop.hbase.coprocessor.RegionCoprocessor. +685 * It won't check if the class can be loaded or not. +686 * Whether a coprocessor is loadable or not will be determined when +687 * a region is opened. +688 * @param className Full class name. +689 * @throws IOException +690 */ +691 public HTableDescriptor addCoprocessor(String className) throws IOException { +692 getDelegateeForModification().addCoprocessor(className); +693 return this; +694 } +695 +696 /** +697 * Add a table coprocessor to this table. The coprocessor +698 * type must be org.apache.hadoop.hbase.coprocessor.RegionCoprocessor. +699 * It won't check if the class can be loaded or not. +700 * Whether a coprocessor is loadable or not will be determined when +701 * a region is opened. +702 * @param jarFilePath Path of the jar file. If it's null, the class will be +703 * loaded from default classloader. +704 * @param className Full class name. +705 * @param priority Priority +706 * @param kvs Arbitrary key-value parameter pairs passed into the coprocessor. +707 * @throws IOException +708 */ +709 public HTableDescriptor addCoprocessor(String className, Path jarFilePath, +710 int priority, final Map<String, String> kvs) +711 throws IOException { +712 getDelegateeForModification().addCoprocessor(className, jarFilePath, priority, kvs); +713 return this; +714 } +715 +716 /** +717 * Add a table coprocessor to this table. The coprocessor +718 * type must be org.apache.hadoop.hbase.coprocessor.RegionCoprocessor. +719 * It won't check if the class can be loaded or not. +720 * Whether a coprocessor is loadable or not will be determined when +721 * a region is opened. +722 * @param specStr The Coprocessor specification all in in one String formatted so matches +723 * {@link HConstants#CP_HTD_ATTR_VALUE_PATTERN} +724 * @throws IOException +725 */ +726 public HTableDescriptor addCoprocessorWithSpec(final String specStr) throws IOException { +727 getDelegateeForModification().addCoprocessorWithSpec(specStr); +728 return this; +729 } +730 +731 /** +732 * Check if the table has an attached co-processor represented by the name className +733 * +734 * @param classNameToMatch - Class name of the co-processor +735 * @return true of the table has a co-processor className +736 */ +737 @Override +738 public boolean hasCoprocessor(String classNameToMatch) { +739 return delegatee.hasCoprocessor(classNameToMatch); +740 } +741 +742 /** +743 * Return the list of attached co-processor represented by their name className +744 * +745 * @return The list of co-processors classNames +746 */ +747 @Override +748 public List<String> getCoprocessors() { +749 return delegatee.getCoprocessors(); +750 } +751 +752 /** +753 * Remove a coprocessor from those set on the table +754 * @param className Class name of the co-processor +755 */ +756 public void removeCoprocessor(String className) { +757 getDelegateeForModification().removeCoprocessor(className); +758 } +759 +760 public final static String NAMESPACE_FAMILY_INFO = TableDescriptorBuilder.NAMESPACE_FAMILY_INFO; +761 public final static byte[] NAMESPACE_FAMILY_INFO_BYTES = TableDescriptorBuilder.NAMESPACE_FAMILY_INFO_BYTES; +762 public final static byte[] NAMESPACE_COL_DESC_BYTES = TableDescriptorBuilder.NAMESPACE_COL_DESC_BYTES; +763 +764 /** Table descriptor for namespace table */ +765 public static final HTableDescriptor NAMESPACE_TABLEDESC +766 = new HTableDescriptor(TableDescriptorBuilder.NAMESPACE_TABLEDESC); +767 +768 @Deprecated +769 public HTableDescriptor setOwner(User owner) { +770 getDelegateeForModification().setOwner(owner); +771 return this; +772 } +773 +774 // used by admin.rb:alter(table_name,*args) to update owner. +775 @Deprecated +776 public HTableDescriptor setOwnerString(String ownerString) { +777 getDelegateeForModification().setOwnerString(ownerString); +778 return this; +779 } +780 +781 @Override +782 @Deprecated +783 public String getOwnerString() { +784 return delegatee.getOwnerString(); +785 } +786 +787 /** +788 * @return This instance serialized with pb with pb magic prefix +789 * @see #parseFrom(byte[]) +790 */ +791 public byte[] toByteArray() { +792 return TableDescriptorBuilder.toByteArray(delegatee); +793 } +794 +795 /** +796 * @param bytes A pb serialized {@link HTableDescriptor} instance with pb magic prefix +797 * @return An instance of {@link HTableDescriptor} made from <code>bytes</code> +798 * @throws DeserializationException +799 * @throws IOException +800 * @see #toByteArray() +801 */ +802 public static HTableDescriptor parseFrom(final byte [] bytes) +803 throws DeserializationException, IOException { +804 TableDescriptor desc = TableDescriptorBuilder.parseFrom(bytes); +805 if (desc instanceof ModifyableTableDescriptor) { +806 return new HTableDescriptor((ModifyableTableDescriptor) desc); +807 } else { +808 return new HTableDescriptor(desc); +809 } +810 } +811 +812 /** +813 * Getter for accessing the configuration value by key +814 */ +815 public String getConfigurationValue(String key) { +816 return delegatee.getValue(key); +817 } +818 +819 /** +820 * Getter for fetching an unmodifiable map. +821 */ +822 public Map<String, String> getConfiguration() { +823 return delegatee.getValues().entrySet().stream() +824 .collect(Collectors.toMap( +825 e -> Bytes.toString(e.getKey().get(), e.getKey().getOffset(), e.getKey().getLength()), +826 e -> Bytes.toString(e.getValue().get(), e.getValue().getOffset(), e.getValue().getLength()) +827 )); +828 } +829 +830 /** +831 * Setter for storing a configuration setting in map. +832 * @param key Config key. Same as XML config key e.g. hbase.something.or.other. +833 * @param value String value. If null, removes the setting. +834 */ +835 public HTableDescriptor setConfiguration(String key, String value) { +836 getDelegateeForModification().setValue(key, value); +837 return this; +838 } +839 +840 /** +841 * Remove a config setting represented by the key from the map +842 */ +843 public void removeConfiguration(final String key) { +844 getDelegateeForModification().removeValue(Bytes.toBytes(key)); +845 } +846 +847 @Override +848 public Bytes getValue(Bytes key) { +849 return delegatee.getValue(key); +850 } +851 +852 @Override +853 public String getValue(String key) { +854 return delegatee.getValue(key); +855 } +856 +857 @Override +858 public byte[] getValue(byte[] key) { +859 return delegatee.getValue(key); +860 } +861 +862 @Override +863 public Set<byte[]> getColumnFamilyNames() { +864 return delegatee.getColumnFamilyNames(); +865 } +866 +867 @Override +868 public boolean hasColumnFamily(byte[] name) { +869 return delegatee.hasColumnFamily(name); +870 } +871 +872 @Override +873 public ColumnFamilyDescriptor getColumnFamily(byte[] name) { +874 return delegatee.getColumnFamily(name); +875 } +876 +877 protected ModifyableTableDescriptor getDelegateeForModification() { +878 return delegatee; +879 } +880}