[02/41] hbase git commit: HBASE-18640 Move mapreduce out of hbase-server into separate module.

2017-08-26 Thread appy
http://git-wip-us.apache.org/repos/asf/hbase/blob/59d03410/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TsvImporterCustomTestMapperForOprAttr.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TsvImporterCustomTestMapperForOprAttr.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TsvImporterCustomTestMapperForOprAttr.java
deleted file mode 100644
index 9d8b8f0..000
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TsvImporterCustomTestMapperForOprAttr.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * 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.hadoop.hbase.mapreduce;
-
-import java.io.IOException;
-
-import org.apache.hadoop.hbase.KeyValue;
-import org.apache.hadoop.hbase.client.Put;
-import 
org.apache.hadoop.hbase.mapreduce.ImportTsv.TsvParser.BadTsvLineException;
-import org.apache.hadoop.hbase.mapreduce.ImportTsv.TsvParser.ParsedLine;
-import org.apache.hadoop.hbase.util.Bytes;
-
-/**
- * 
- * Just shows a simple example of how the attributes can be extracted and added
- * to the puts
- */
-public class TsvImporterCustomTestMapperForOprAttr extends TsvImporterMapper {
-  @Override
-  protected void populatePut(byte[] lineBytes, ParsedLine parsed, Put put, int 
i)
-  throws BadTsvLineException, IOException {
-KeyValue kv;
-kv = new KeyValue(lineBytes, parsed.getRowKeyOffset(), 
parsed.getRowKeyLength(),
-parser.getFamily(i), 0, parser.getFamily(i).length, 
parser.getQualifier(i), 0,
-parser.getQualifier(i).length, ts, KeyValue.Type.Put, lineBytes, 
parsed.getColumnOffset(i),
-parsed.getColumnLength(i));
-if (parsed.getIndividualAttributes() != null) {
-  String[] attributes = parsed.getIndividualAttributes();
-  for (String attr : attributes) {
-String[] split = attr.split(ImportTsv.DEFAULT_ATTRIBUTES_SEPERATOR);
-if (split == null || split.length <= 1) {
-  throw new BadTsvLineException("Invalid attributes seperator 
specified" + attributes);
-} else {
-  if (split[0].length() <= 0 || split[1].length() <= 0) {
-throw new BadTsvLineException("Invalid attributes seperator 
specified" + attributes);
-  }
-  put.setAttribute(split[0], Bytes.toBytes(split[1]));
-}
-  }
-}
-put.add(kv);
-  }
-}

http://git-wip-us.apache.org/repos/asf/hbase/blob/59d03410/hbase-server/src/test/java/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.java
index f641887..a81d268 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.java
@@ -65,7 +65,6 @@ import 
org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment;
 import org.apache.hadoop.hbase.coprocessor.RegionObserver;
 import org.apache.hadoop.hbase.coprocessor.RegionServerCoprocessorEnvironment;
 import org.apache.hadoop.hbase.coprocessor.RegionServerObserver;
-import org.apache.hadoop.hbase.mapreduce.TableInputFormatBase;
 import org.apache.hadoop.hbase.master.HMaster;
 import org.apache.hadoop.hbase.master.MasterCoprocessorHost;
 import org.apache.hadoop.hbase.master.TableNamespaceManager;
@@ -336,7 +335,7 @@ public class TestNamespaceAuditor {
 byte[] columnFamily = Bytes.toBytes("info");
 HTableDescriptor tableDescOne = new HTableDescriptor(tableTwo);
 tableDescOne.addFamily(new HColumnDescriptor(columnFamily));
-ADMIN.createTable(tableDescOne, Bytes.toBytes("1"), Bytes.toBytes("2000"), 
initialRegions);
+ADMIN.createTable(tableDescOne, Bytes.toBytes("0"), Bytes.toBytes("9"), 
initialRegions);
 Connection connection = 
ConnectionFactory.createConnection(UTIL.getConfiguration());
 try (Table table = connection.getTable(tableTwo)) {
   UTIL.loadNumericRows(table, 

[02/41] hbase git commit: HBASE-18640 Move mapreduce out of hbase-server into separate module.

2017-08-25 Thread appy
http://git-wip-us.apache.org/repos/asf/hbase/blob/664b6be0/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TsvImporterCustomTestMapperForOprAttr.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TsvImporterCustomTestMapperForOprAttr.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TsvImporterCustomTestMapperForOprAttr.java
deleted file mode 100644
index 9d8b8f0..000
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TsvImporterCustomTestMapperForOprAttr.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * 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.hadoop.hbase.mapreduce;
-
-import java.io.IOException;
-
-import org.apache.hadoop.hbase.KeyValue;
-import org.apache.hadoop.hbase.client.Put;
-import 
org.apache.hadoop.hbase.mapreduce.ImportTsv.TsvParser.BadTsvLineException;
-import org.apache.hadoop.hbase.mapreduce.ImportTsv.TsvParser.ParsedLine;
-import org.apache.hadoop.hbase.util.Bytes;
-
-/**
- * 
- * Just shows a simple example of how the attributes can be extracted and added
- * to the puts
- */
-public class TsvImporterCustomTestMapperForOprAttr extends TsvImporterMapper {
-  @Override
-  protected void populatePut(byte[] lineBytes, ParsedLine parsed, Put put, int 
i)
-  throws BadTsvLineException, IOException {
-KeyValue kv;
-kv = new KeyValue(lineBytes, parsed.getRowKeyOffset(), 
parsed.getRowKeyLength(),
-parser.getFamily(i), 0, parser.getFamily(i).length, 
parser.getQualifier(i), 0,
-parser.getQualifier(i).length, ts, KeyValue.Type.Put, lineBytes, 
parsed.getColumnOffset(i),
-parsed.getColumnLength(i));
-if (parsed.getIndividualAttributes() != null) {
-  String[] attributes = parsed.getIndividualAttributes();
-  for (String attr : attributes) {
-String[] split = attr.split(ImportTsv.DEFAULT_ATTRIBUTES_SEPERATOR);
-if (split == null || split.length <= 1) {
-  throw new BadTsvLineException("Invalid attributes seperator 
specified" + attributes);
-} else {
-  if (split[0].length() <= 0 || split[1].length() <= 0) {
-throw new BadTsvLineException("Invalid attributes seperator 
specified" + attributes);
-  }
-  put.setAttribute(split[0], Bytes.toBytes(split[1]));
-}
-  }
-}
-put.add(kv);
-  }
-}

http://git-wip-us.apache.org/repos/asf/hbase/blob/664b6be0/hbase-server/src/test/java/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.java
--
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.java
index f641887..a81d268 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.java
@@ -65,7 +65,6 @@ import 
org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment;
 import org.apache.hadoop.hbase.coprocessor.RegionObserver;
 import org.apache.hadoop.hbase.coprocessor.RegionServerCoprocessorEnvironment;
 import org.apache.hadoop.hbase.coprocessor.RegionServerObserver;
-import org.apache.hadoop.hbase.mapreduce.TableInputFormatBase;
 import org.apache.hadoop.hbase.master.HMaster;
 import org.apache.hadoop.hbase.master.MasterCoprocessorHost;
 import org.apache.hadoop.hbase.master.TableNamespaceManager;
@@ -336,7 +335,7 @@ public class TestNamespaceAuditor {
 byte[] columnFamily = Bytes.toBytes("info");
 HTableDescriptor tableDescOne = new HTableDescriptor(tableTwo);
 tableDescOne.addFamily(new HColumnDescriptor(columnFamily));
-ADMIN.createTable(tableDescOne, Bytes.toBytes("1"), Bytes.toBytes("2000"), 
initialRegions);
+ADMIN.createTable(tableDescOne, Bytes.toBytes("0"), Bytes.toBytes("9"), 
initialRegions);
 Connection connection = 
ConnectionFactory.createConnection(UTIL.getConfiguration());
 try (Table table = connection.getTable(tableTwo)) {
   UTIL.loadNumericRows(table,