Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HBASE-28436 Addendum fix naming issue #5855

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ final class ConnectionRegistryFactory {

private static final Logger LOG = LoggerFactory.getLogger(ConnectionRegistryFactory.class);

private static final ImmutableMap<String, ConnectionRegistryURIFactory> CREATORS;
private static final ImmutableMap<String, ConnectionRegistryURIFactory> FACTORIES;
static {
ImmutableMap.Builder<String, ConnectionRegistryURIFactory> builder = ImmutableMap.builder();
for (ConnectionRegistryURIFactory factory : ServiceLoader
.load(ConnectionRegistryURIFactory.class)) {
builder.put(factory.getScheme().toLowerCase(), factory);
}
// throw IllegalArgumentException if there are duplicated keys
CREATORS = builder.buildOrThrow();
FACTORIES = builder.buildOrThrow();
}

private ConnectionRegistryFactory() {
Expand All @@ -69,12 +69,12 @@ static ConnectionRegistry create(URI uri, Configuration conf, User user) throws
LOG.warn("No scheme specified for {}, fallback to use old way", uri);
return create(conf, user);
}
ConnectionRegistryURIFactory creator = CREATORS.get(uri.getScheme().toLowerCase());
if (creator == null) {
LOG.warn("No creator registered for {}, fallback to use old way", uri);
ConnectionRegistryURIFactory factory = FACTORIES.get(uri.getScheme().toLowerCase());
if (factory == null) {
LOG.warn("No factory registered for {}, fallback to use old way", uri);
return create(conf, user);
}
return creator.create(uri, conf, user);
return factory.create(uri, conf, user);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
* Connection registry creator implementation for creating {@link RpcConnectionRegistry}.
*/
@InterfaceAudience.Private
public class RpcConnectionRegistryCreator implements ConnectionRegistryURIFactory {
public class RpcConnectionRegistryURIFactory implements ConnectionRegistryURIFactory {

private static final Logger LOG = LoggerFactory.getLogger(RpcConnectionRegistryCreator.class);
private static final Logger LOG = LoggerFactory.getLogger(RpcConnectionRegistryURIFactory.class);

@Override
public ConnectionRegistry create(URI uri, Configuration conf, User user) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
* Connection registry creator implementation for creating {@link ZKConnectionRegistry}.
*/
@InterfaceAudience.Private
public class ZKConnectionRegistryCreator implements ConnectionRegistryURIFactory {
public class ZKConnectionRegistryURIFactory implements ConnectionRegistryURIFactory {

private static final Logger LOG = LoggerFactory.getLogger(ZKConnectionRegistryCreator.class);
private static final Logger LOG = LoggerFactory.getLogger(ZKConnectionRegistryURIFactory.class);

@Override
public ConnectionRegistry create(URI uri, Configuration conf, User user) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
org.apache.hadoop.hbase.client.RpcConnectionRegistryCreator
org.apache.hadoop.hbase.client.ZKConnectionRegistryCreator
org.apache.hadoop.hbase.client.RpcConnectionRegistryURIFactory
org.apache.hadoop.hbase.client.ZKConnectionRegistryURIFactory
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@
* Make sure we can successfully parse the URI component
*/
@Category({ ClientTests.class, SmallTests.class })
public class TestConnectionRegistryCreatorUriParsing {
public class TestConnectionRegistryUriParsing {

@ClassRule
public static final HBaseClassTestRule CLASS_RULE =
HBaseClassTestRule.forClass(TestConnectionRegistryCreatorUriParsing.class);
HBaseClassTestRule.forClass(TestConnectionRegistryUriParsing.class);

private Configuration conf;

Expand Down