keith-turner commented on a change in pull request #743: New MapReduce API
URL: https://github.com/apache/accumulo/pull/743#discussion_r231184482
 
 

 ##########
 File path: 
hadoop-mapreduce/src/main/java/org/apache/accumulo/hadoop/mapreduce/OutputInfo.java
 ##########
 @@ -0,0 +1,137 @@
+/*
+ * 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.hadoop.mapreduce;
+
+import java.util.Optional;
+import java.util.Properties;
+
+import org.apache.accumulo.core.client.BatchWriter;
+import org.apache.accumulo.core.client.BatchWriterConfig;
+import org.apache.accumulo.core.client.ClientInfo;
+import org.apache.accumulo.hadoopImpl.mapreduce.OutputInfoImpl;
+import org.apache.hadoop.mapreduce.Job;
+
+/**
+ * Object containing all the information needed for the Map Reduce job. This 
object is passed to
+ * {@link AccumuloOutputFormat#setInfo(Job, OutputInfo)}. It uses a fluent API 
like so:
+ *
+ * <pre>
+ * 
OutputInfo.builder().clientInfo(clientInfo).batchWriterOptions(bwConfig).build();
+ * </pre>
+ *
+ * @since 2.0
+ */
+public interface OutputInfo {
+  /**
+   * @return the client info set using OutputInfo.builder().clientInfo(info)
+   */
+  ClientInfo getClientInfo();
+
+  /**
+   * @return the client properties set using 
OutputInfo.builder().clientProperties(props)
+   */
+  Properties getClientProperties();
+
+  /**
+   * @return the BatchWriterConfig set using 
OutputInfo.builder()...batchWriterOptions(conf)
+   */
+  Optional<BatchWriterConfig> getBatchWriterOptions();
+
+  /**
+   * @return the default tame name set using 
OutputInfo.builder()...defaultTableName(name)
+   */
+  Optional<String> getDefaultTableName();
+
+  /**
+   * @return boolean if creating tables or not
+   */
+  boolean isCreateTables();
+
+  /**
+   * @return boolean if running simulation mode or not
+   */
+  boolean isSimulationMode();
+
+  /**
+   * @return builder for creating a {@link OutputInfo}
+   */
+  public static OutputInfoBuilder.ClientParams builder() {
+    return new OutputInfoImpl.OutputInfoBuilderImpl();
+  }
+
+  interface OutputInfoBuilder {
+    interface ClientParams {
+      /**
+       * Set the connection information needed to communicate with Accumulo in 
this job.
+       *
+       * @param clientInfo
+       *          Accumulo connection information
+       */
+      OutputOptions clientInfo(ClientInfo clientInfo);
+
+      /**
+       * Set the connection information needed to communicate with Accumulo in 
this job.
+       *
+       * @param clientProps
+       *          Accumulo connection information
+       */
+      OutputOptions clientProperties(Properties clientProps);
 
 Review comment:
   I think clientInfo can also have scanner and/or batch writer config.  If 
this stuff is ignored, need to document that.  The best thing would be to 
respect config from clientinfo AND whatever can be set by clientinfo there is 
no need to have map reduce APIs for that. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to