incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [1/3] Code cleanup and more tests.
Date Tue, 07 Jan 2014 14:59:29 GMT
Updated Branches:
  refs/heads/master bce688d16 -> a9fe3d40e


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/7080fbe8/blur-mapred/src/main/java/org/apache/blur/mapreduce/lib/BlurOutputFormat.java
----------------------------------------------------------------------
diff --git a/blur-mapred/src/main/java/org/apache/blur/mapreduce/lib/BlurOutputFormat.java
b/blur-mapred/src/main/java/org/apache/blur/mapreduce/lib/BlurOutputFormat.java
index aa5ae1b..c5f4468 100644
--- a/blur-mapred/src/main/java/org/apache/blur/mapreduce/lib/BlurOutputFormat.java
+++ b/blur-mapred/src/main/java/org/apache/blur/mapreduce/lib/BlurOutputFormat.java
@@ -30,9 +30,7 @@ import org.apache.blur.analysis.FieldManager;
 import org.apache.blur.log.Log;
 import org.apache.blur.log.LogFactory;
 import org.apache.blur.lucene.LuceneVersionConstant;
-import org.apache.blur.lucene.codec.Blur021Codec;
 import org.apache.blur.lucene.codec.Blur022Codec;
-import org.apache.blur.manager.writer.TransactionRecorder;
 import org.apache.blur.mapreduce.lib.BlurMutate.MUTATE_TYPE;
 import org.apache.blur.server.TableContext;
 import org.apache.blur.store.hdfs.HdfsDirectory;
@@ -46,6 +44,7 @@ import org.apache.blur.thrift.generated.Record;
 import org.apache.blur.thrift.generated.TableDescriptor;
 import org.apache.blur.utils.BlurConstants;
 import org.apache.blur.utils.BlurUtil;
+import org.apache.blur.utils.RowDocumentUtil;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
@@ -470,7 +469,7 @@ public class BlurOutputFormat extends OutputFormat<Text, BlurMutate>
{
       if (_countersSetup) {
         _columnCount.increment(record.getColumns().size());
       }
-      List<Field> document = TransactionRecorder.getDoc(_fieldManager, blurRecord.getRowId(),
record);
+      List<Field> document = RowDocumentUtil.getDoc(_fieldManager, blurRecord.getRowId(),
record);
       List<Field> dup = _documents.put(recordId, document);
       if (_countersSetup) {
         if (dup != null) {

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/7080fbe8/blur-thrift/src/main/java/org/apache/blur/thrift/util/BlurThriftHelper.java
----------------------------------------------------------------------
diff --git a/blur-thrift/src/main/java/org/apache/blur/thrift/util/BlurThriftHelper.java b/blur-thrift/src/main/java/org/apache/blur/thrift/util/BlurThriftHelper.java
index 1f2c4d8..aaef38c 100644
--- a/blur-thrift/src/main/java/org/apache/blur/thrift/util/BlurThriftHelper.java
+++ b/blur-thrift/src/main/java/org/apache/blur/thrift/util/BlurThriftHelper.java
@@ -17,6 +17,7 @@ package org.apache.blur.thrift.util;
  * limitations under the License.
  */
 import java.util.Arrays;
+import java.util.List;
 
 import org.apache.blur.thrift.generated.BlurQuery;
 import org.apache.blur.thrift.generated.Column;
@@ -118,4 +119,16 @@ public class BlurThriftHelper {
     return left.recordId.equals(right.recordId) && left.family.equals(right.family);
   }
 
+  public static RowMutation newRowMutation(String table, Row row) {
+    RowMutation rowMutation = new RowMutation();
+    rowMutation.setTable(table);
+    rowMutation.setRowMutationType(RowMutationType.REPLACE_ROW);
+    rowMutation.setRowId(row.getId());
+    List<Record> records = row.getRecords();
+    for (Record record : records) {
+      rowMutation.addToRecordMutations(new RecordMutation(RecordMutationType.REPLACE_ENTIRE_RECORD,
record));
+    }
+    return rowMutation;
+  }
+
 }


Mime
View raw message