incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [6/6] git commit: Didn't mean to check in those files.
Date Mon, 26 Aug 2013 11:28:59 GMT
Didn't mean to check in those files.


Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/426d3c3b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/426d3c3b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/426d3c3b

Branch: refs/heads/master
Commit: 426d3c3b754c5037917bba247b3c0e7c8c6d76f3
Parents: 5d70bfa
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Mon Aug 26 07:28:22 2013 -0400
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Mon Aug 26 07:28:22 2013 -0400

----------------------------------------------------------------------
 .../thrift/util/ExampleSpatialLoaderv2.java     | 96 --------------------
 .../blur/thrift/util/OverloadSystemv2.java      | 61 -------------
 2 files changed, 157 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/426d3c3b/blur-thrift/src/main/java/org/apache/blur/thrift/util/ExampleSpatialLoaderv2.java
----------------------------------------------------------------------
diff --git a/blur-thrift/src/main/java/org/apache/blur/thrift/util/ExampleSpatialLoaderv2.java
b/blur-thrift/src/main/java/org/apache/blur/thrift/util/ExampleSpatialLoaderv2.java
deleted file mode 100644
index 32dd439..0000000
--- a/blur-thrift/src/main/java/org/apache/blur/thrift/util/ExampleSpatialLoaderv2.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package org.apache.blur.thrift.util;
-
-import java.io.BufferedReader;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.blur.thirdparty.thrift_0_9_0.TException;
-import org.apache.blur.thrift.BlurClient;
-import org.apache.blur.thrift.generated.Blur.Iface;
-import org.apache.blur.thrift.generated.BlurException;
-import org.apache.blur.thrift.generated.Column;
-import org.apache.blur.thrift.generated.Record;
-import org.apache.blur.thrift.generated.RecordMutation;
-import org.apache.blur.thrift.generated.RecordMutationType;
-import org.apache.blur.thrift.generated.RowMutation;
-import org.apache.blur.thrift.generated.RowMutationType;
-
-public class ExampleSpatialLoaderv2 {
-
-  public static void main(String[] args) throws IOException, BlurException, TException {
-    Iface client = BlurClient.getClient(args[0]);
-    String tableName = args[1];
-    BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(
-        "/Users/amccurry/Downloads/zipcode/zipcode.csv")));
-    String line;
-    List<String> header = new ArrayList<String>();
-    List<RowMutation> batch = new ArrayList<RowMutation>();
-    int count = 0;
-    int total = 0;
-    int max = 1000;
-    while ((line = reader.readLine()) != null) {
-      if (count >= max) {
-        System.out.println(total);
-        count = 0;
-      }
-      line = line.trim();
-      if (line.isEmpty()) {
-        continue;
-      }
-      String[] split = line.split("\",\"");
-      if (header.isEmpty()) {
-        for (String s : split) {
-          header.add(trim(s));
-        }
-      } else {
-        Record record = new Record();
-        String zip = trim(split[0]);
-        record.setRecordId(zip);
-        record.setFamily("zip");
-        record.addToColumns(new Column("zip", zip));
-        record.addToColumns(new Column("city", trim(split[1])));
-        record.addToColumns(new Column("state", trim(split[2])));
-        record.addToColumns(new Column("location", trim(split[3]) + "," + trim(split[4])));
-        record.addToColumns(new Column("timezone", trim(split[5])));
-        record.addToColumns(new Column("dst", trim(split[6])));
-
-        RowMutation mutation = new RowMutation();
-        mutation.setTable(tableName);
-        mutation.setRowId(zip);
-        mutation.setRowMutationType(RowMutationType.REPLACE_ROW);
-        List<RecordMutation> recordMutations = new ArrayList<RecordMutation>();
-        RecordMutation recordMutation = new RecordMutation();
-        recordMutation.setRecord(record);
-        recordMutation.setRecordMutationType(RecordMutationType.REPLACE_ENTIRE_RECORD);
-        recordMutations.add(recordMutation);
-        mutation.setRecordMutations(recordMutations);
-
-        // zip=99950
-        // city=Ketchikan
-        // state=AK
-        // latitude=55.875767
-        // longitude=-131.46633
-        // timezone=-9
-        // dst=1
-        batch.add(mutation);
-        count++;
-        total++;
-        if (batch.size() > 100) {
-          client.mutateBatch(batch);
-          batch.clear();
-        }
-      }
-    }
-    if (batch.size() > 0) {
-      client.mutateBatch(batch);
-    }
-  }
-
-  private static String trim(String s) {
-    return s.replace("\"", "");
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/426d3c3b/blur-thrift/src/main/java/org/apache/blur/thrift/util/OverloadSystemv2.java
----------------------------------------------------------------------
diff --git a/blur-thrift/src/main/java/org/apache/blur/thrift/util/OverloadSystemv2.java b/blur-thrift/src/main/java/org/apache/blur/thrift/util/OverloadSystemv2.java
deleted file mode 100644
index e872d95..0000000
--- a/blur-thrift/src/main/java/org/apache/blur/thrift/util/OverloadSystemv2.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package org.apache.blur.thrift.util;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
-
-import org.apache.blur.thirdparty.thrift_0_9_0.TException;
-import org.apache.blur.thrift.BlurClient;
-import org.apache.blur.thrift.generated.Blur.Iface;
-import org.apache.blur.thrift.generated.BlurException;
-import org.apache.blur.thrift.generated.BlurQuery;
-import org.apache.blur.thrift.generated.BlurResults;
-import org.apache.blur.thrift.generated.Selector;
-import org.apache.blur.thrift.generated.Query;
-
-public class OverloadSystemv2 {
-
-  public static void main(String[] args) throws InterruptedException, ExecutionException
{
-
-    ExecutorService service = Executors.newFixedThreadPool(100);
-    final Iface client = BlurClient.getClient("blur-vm:40010");
-
-    while (true) {
-      List<Future<Void>> futures = new ArrayList<Future<Void>>();
-      for (int i = 0; i < 100; i++) {
-        futures.add(service.submit(new Callable<Void>() {
-          @Override
-          public Void call() throws Exception {
-            BlurQuery blurQuery = new BlurQuery();
-            Query query = new Query();
-            query.setQuery("fam0.col0:*a* fam0.col0:*b* fam0.col0:*d* fam0.col0:*e* fam1.col0:*a*
fam1.col0:*b* fam1.col0:*d* fam1.col0:*e*");
-            blurQuery.setQuery(query);
-            blurQuery.setUseCacheIfPresent(false);
-            blurQuery.setCacheResult(false);
-            blurQuery.setSelector(new Selector());
-            blurQuery.setStart(0);
-            blurQuery.setStart(100);
-            try {
-              BlurResults results = client.query("testtable", blurQuery);
-              System.out.println(results.getTotalResults());
-            } catch (BlurException e) {
-              e.printStackTrace();
-            } catch (TException e) {
-              e.printStackTrace();
-            }
-            return null;
-          }
-        }));
-
-      }
-      for (Future<Void> future : futures) {
-        future.get();
-      }
-    }
-  }
-
-}


Mime
View raw message