Updated Branches: refs/heads/master d05d4ba2a -> 6d21e140a
Removing files that shouldn't have been checked in. Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/6d21e140 Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/6d21e140 Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/6d21e140 Branch: refs/heads/master Commit: 6d21e140a3df28782da8496188f22612dc61a10c Parents: d05d4ba Author: Aaron McCurry <[email protected]> Authored: Sat Aug 17 22:12:24 2013 -0400 Committer: Aaron McCurry <[email protected]> Committed: Sat Aug 17 22:12:24 2013 -0400 ---------------------------------------------------------------------- .../thrift/util/DebugSimpleQueryExample.java | 51 ----------- .../blur/thrift/util/ExampleSpatialLoader.java | 96 -------------------- .../apache/blur/thrift/util/OverloadSystem.java | 61 ------------- 3 files changed, 208 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/6d21e140/blur-thrift/src/main/java/org/apache/blur/thrift/util/DebugSimpleQueryExample.java ---------------------------------------------------------------------- diff --git a/blur-thrift/src/main/java/org/apache/blur/thrift/util/DebugSimpleQueryExample.java b/blur-thrift/src/main/java/org/apache/blur/thrift/util/DebugSimpleQueryExample.java deleted file mode 100644 index da7cc87..0000000 --- a/blur-thrift/src/main/java/org/apache/blur/thrift/util/DebugSimpleQueryExample.java +++ /dev/null @@ -1,51 +0,0 @@ -package org.apache.blur.thrift.util; - -/** - * 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. - */ -import java.io.IOException; - -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.BlurResult; -import org.apache.blur.thrift.generated.BlurResults; -import org.apache.blur.thrift.generated.SimpleQuery; - -public class DebugSimpleQueryExample { - - public static void main(String[] args) throws BlurException, TException, IOException { - String connectionStr = args[0]; - String tableName = args[1]; -// String query = args[2]; - String query = "cool AND examiner"; - - Iface client = BlurClient.getClient(connectionStr); - - final BlurQuery blurQuery = new BlurQuery(); - SimpleQuery simpleQuery = new SimpleQuery(); - blurQuery.setSimpleQuery(simpleQuery); - simpleQuery.setQueryStr(query); - BlurResults results = client.query(tableName, blurQuery); - System.out.println("Total Results: " + results.totalResults); - - for (BlurResult result : results.getResults()) { - System.out.println(result); - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/6d21e140/blur-thrift/src/main/java/org/apache/blur/thrift/util/ExampleSpatialLoader.java ---------------------------------------------------------------------- diff --git a/blur-thrift/src/main/java/org/apache/blur/thrift/util/ExampleSpatialLoader.java b/blur-thrift/src/main/java/org/apache/blur/thrift/util/ExampleSpatialLoader.java deleted file mode 100644 index c01d60a..0000000 --- a/blur-thrift/src/main/java/org/apache/blur/thrift/util/ExampleSpatialLoader.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 ExampleSpatialLoader { - - 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/6d21e140/blur-thrift/src/main/java/org/apache/blur/thrift/util/OverloadSystem.java ---------------------------------------------------------------------- diff --git a/blur-thrift/src/main/java/org/apache/blur/thrift/util/OverloadSystem.java b/blur-thrift/src/main/java/org/apache/blur/thrift/util/OverloadSystem.java deleted file mode 100644 index a8d1e8a..0000000 --- a/blur-thrift/src/main/java/org/apache/blur/thrift/util/OverloadSystem.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.SimpleQuery; - -public class OverloadSystem { - - 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(); - SimpleQuery simpleQuery = new SimpleQuery(); - simpleQuery.setQueryStr("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.setSimpleQuery(simpleQuery); - 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(); - } - } - } - -}
