accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmil...@apache.org
Subject [accumulo] 05/09: Create Accumulo class as main entry point #636
Date Thu, 20 Sep 2018 17:48:07 GMT
This is an automated email from the ASF dual-hosted git repository.

mmiller pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/accumulo.git

commit 486b79981c9a91a0852b0f2ff7402c91f37a17be
Author: Mike Miller <mmiller@apache.org>
AuthorDate: Fri Sep 7 11:34:02 2018 -0400

    Create Accumulo class as main entry point #636
---
 .../java/org/apache/accumulo/core/Accumulo.java    | 38 ++++++++++++++++++++++
 .../accumulo/core/client/AccumuloClient.java       | 12 +------
 2 files changed, 39 insertions(+), 11 deletions(-)

diff --git a/core/src/main/java/org/apache/accumulo/core/Accumulo.java b/core/src/main/java/org/apache/accumulo/core/Accumulo.java
new file mode 100644
index 0000000..f0c8009
--- /dev/null
+++ b/core/src/main/java/org/apache/accumulo/core/Accumulo.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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.
+ */
+package org.apache.accumulo.core;
+
+import org.apache.accumulo.core.client.AccumuloClient;
+import org.apache.accumulo.core.client.impl.AccumuloClientImpl;
+
+/**
+ * The main entry point for Accumulo public API.
+ */
+public final class Accumulo {
+
+  private Accumulo() {}
+
+  /**
+   * Create an Accumulo client builder, used to construct a client.
+   *
+   * @return a builder object for Accumulo clients
+   */
+  public static AccumuloClient.ClientInfoOptions newClient() {
+    return new AccumuloClientImpl.AccumuloClientBuilderImpl();
+  }
+
+}
diff --git a/core/src/main/java/org/apache/accumulo/core/client/AccumuloClient.java b/core/src/main/java/org/apache/accumulo/core/client/AccumuloClient.java
index 1fe865a..2676608 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/AccumuloClient.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/AccumuloClient.java
@@ -23,7 +23,6 @@ import org.apache.accumulo.core.client.admin.NamespaceOperations;
 import org.apache.accumulo.core.client.admin.ReplicationOperations;
 import org.apache.accumulo.core.client.admin.SecurityOperations;
 import org.apache.accumulo.core.client.admin.TableOperations;
-import org.apache.accumulo.core.client.impl.AccumuloClientImpl;
 import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
 import org.apache.accumulo.core.security.Authorizations;
 
@@ -35,7 +34,7 @@ import org.apache.accumulo.core.security.Authorizations;
  * Supports fluent API. Various options can be provided to {@link #builder()} and when finished
a
  * call to build() will return the AccumuloClient object. For example:
  *
- * {@code AccumuloClient.builder().forInstance(instanceName, zookeepers)
+ * {@code Accumulo.newClient().forInstance(instanceName, zookeepers)
  *         .usingPassword(user, password).withZkTimeout(1234).build();}
  *
  * @since 2.0.0
@@ -520,13 +519,4 @@ public interface AccumuloClient {
   public interface FromOptions extends ConnectionOptions, PropertyOptions, AuthenticationArgs
{
 
   }
-
-  /**
-   * Creates builder for AccumuloClient.
-   *
-   * @return this builder
-   */
-  public static ClientInfoOptions builder() {
-    return new AccumuloClientImpl.AccumuloClientBuilderImpl();
-  }
 }


Mime
View raw message