You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2018/10/19 15:50:11 UTC

[GitHub] mikewalch commented on a change in pull request #712: Cleanup MapReduce package and API

mikewalch commented on a change in pull request #712: Cleanup MapReduce package and API
URL: https://github.com/apache/accumulo/pull/712#discussion_r226694815
 
 

 ##########
 File path: client/mapreduce/src/main/java/org/apache/accumulo/mapreduce/impl/InputInfoImpl.java
 ##########
 @@ -0,0 +1,168 @@
+package org.apache.accumulo.mapreduce.impl;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.accumulo.core.client.ClientInfo;
+import org.apache.accumulo.core.client.IteratorSetting;
+import org.apache.accumulo.core.client.sample.SamplerConfiguration;
+import org.apache.accumulo.core.data.Range;
+import org.apache.accumulo.core.security.Authorizations;
+import org.apache.accumulo.core.util.Pair;
+import org.apache.accumulo.mapreduce.InputInfo;
+import org.apache.hadoop.io.Text;
+
+public class InputInfoImpl implements InputInfo {
+  String tableName;
+  ClientInfo clientInfo;
+  Authorizations scanAuths;
+  String context;
+  String logLevel;
+  Collection<Range> ranges;
+  Collection<Pair<Text, Text>> cfcqPairs;
+  IteratorSetting cfg;
+  SamplerConfiguration samplerConfig;
+  Map<String, String> hints;
+
+  public InputInfoImpl(String tableName, ClientInfo clientInfo, Authorizations scanAuths, String context,
+                       String logLevel, Collection<Range> ranges, Collection<Pair<Text, Text>> cfcqPairs, IteratorSetting cfg,
+                       SamplerConfiguration samplerConfig, Map<String, String> hints) {
+    this.tableName = tableName;
+    this.clientInfo = clientInfo;
+    this.scanAuths = scanAuths;
+    this.context = context;
+    this.logLevel = logLevel;
+    this.ranges = ranges;
+    this.cfcqPairs = cfcqPairs;
+    this.cfg = cfg;
+    this.samplerConfig = samplerConfig;
+    this.hints = hints;
+  }
+
+  @Override
+  public String getTableName() {
+    return tableName;
+  }
+
+  @Override
+  public ClientInfo getClientInfo() {
+    return clientInfo;
+  }
+
+  public Authorizations getScanAuths() {
+    return scanAuths;
+  }
+
+  @Override
+  public String getContext() {
+    return context;
+  }
+
+  @Override
+  public String getLogLevel() {
+    return logLevel;
+  }
+
+  @Override
+  public Collection<Range> getRanges() {
+    return ranges;
+  }
+
+  @Override
+  public Collection<Pair<Text, Text>> getCfcqPairs() {
+    return cfcqPairs;
+  }
+
+  @Override
+  public IteratorSetting getIterators() {
+    return cfg;
+  }
+
+  @Override
+  public SamplerConfiguration getSamplerConfig() {
+    return samplerConfig;
+  }
+
+  @Override
+  public Map<String, String> getHints() {
+    return hints;
+  }
+
+  public static class InputInfoBuilderImpl implements InputFormatBuilder, InputInfo.InputFormatBuilder.ClientParams, InputInfo.InputFormatBuilder.TableParams,
+  InputInfo.InputFormatBuilder.AuthsParams, InputInfo.InputFormatBuilder.InputFormatOptions {
+
+    String tableName;
+    ClientInfo clientInfo;
+    Authorizations scanAuths;
+
+    String context;
+    String logLevel;
+    Collection<Range> ranges;
+    Collection<Pair<Text, Text>> cfcqPairs;
+    IteratorSetting cfg;
+    SamplerConfiguration samplerConfig;
+    Map<String, String> hints;
+
+    @Override
+    public InputInfo.InputFormatBuilder.TableParams clientInfo(ClientInfo clientInfo) {
+      this.clientInfo = clientInfo;
+      return this;
+    }
+    @Override
+    public InputInfo.InputFormatBuilder.TableParams clientProperties(Properties clientPropsFiles) {
 
 Review comment:
   The naming of `clientPropsFiles` should be changed to `clientProps` as there is no file.
   
   However, you could add a `clientPropertiesFile` method and use the code in my PR #715 to get ClientInfo from the file path.
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services