incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [05/92] [abbrv] [partial] Fixed BLUR-126.
Date Tue, 11 Jun 2013 02:40:51 GMT
http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b0e26648/blur-thrift/src/main/java/org/apache/blur/thrift/util/DisableTable.java
----------------------------------------------------------------------
diff --git a/blur-thrift/src/main/java/org/apache/blur/thrift/util/DisableTable.java b/blur-thrift/src/main/java/org/apache/blur/thrift/util/DisableTable.java
new file mode 100644
index 0000000..68c3eb6
--- /dev/null
+++ b/blur-thrift/src/main/java/org/apache/blur/thrift/util/DisableTable.java
@@ -0,0 +1,36 @@
+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.BlurException;
+import org.apache.blur.thrift.generated.Blur.Iface;
+
+
+public class DisableTable {
+
+  public static void main(String[] args) throws BlurException, TException, IOException {
+    String connectionStr = args[0];
+    final String tableName = args[1];
+
+    Iface client = BlurClient.getClient(connectionStr);
+    client.disableTable(tableName);
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b0e26648/blur-thrift/src/main/java/org/apache/blur/thrift/util/EnableTable.java
----------------------------------------------------------------------
diff --git a/blur-thrift/src/main/java/org/apache/blur/thrift/util/EnableTable.java b/blur-thrift/src/main/java/org/apache/blur/thrift/util/EnableTable.java
new file mode 100644
index 0000000..3acb593
--- /dev/null
+++ b/blur-thrift/src/main/java/org/apache/blur/thrift/util/EnableTable.java
@@ -0,0 +1,36 @@
+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.BlurException;
+import org.apache.blur.thrift.generated.Blur.Iface;
+
+
+public class EnableTable {
+
+  public static void main(String[] args) throws BlurException, TException, IOException {
+    String connectionStr = args[0];
+    final String tableName = args[1];
+
+    Iface client = BlurClient.getClient(connectionStr);
+    client.enableTable(tableName);
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b0e26648/blur-thrift/src/main/java/org/apache/blur/thrift/util/ListTables.java
----------------------------------------------------------------------
diff --git a/blur-thrift/src/main/java/org/apache/blur/thrift/util/ListTables.java b/blur-thrift/src/main/java/org/apache/blur/thrift/util/ListTables.java
new file mode 100644
index 0000000..986d16a
--- /dev/null
+++ b/blur-thrift/src/main/java/org/apache/blur/thrift/util/ListTables.java
@@ -0,0 +1,35 @@
+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.BlurException;
+import org.apache.blur.thrift.generated.Blur.Iface;
+
+
+public class ListTables {
+
+  public static void main(String[] args) throws BlurException, TException, IOException {
+    String connectionStr = args[0];
+
+    Iface client = BlurClient.getClient(connectionStr);
+    System.out.println(client.tableList());
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b0e26648/blur-thrift/src/main/java/org/apache/blur/thrift/util/LoadData.java
----------------------------------------------------------------------
diff --git a/blur-thrift/src/main/java/org/apache/blur/thrift/util/LoadData.java b/blur-thrift/src/main/java/org/apache/blur/thrift/util/LoadData.java
new file mode 100644
index 0000000..e13908f
--- /dev/null
+++ b/blur-thrift/src/main/java/org/apache/blur/thrift/util/LoadData.java
@@ -0,0 +1,129 @@
+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.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+
+import org.apache.blur.thirdparty.thrift_0_9_0.TException;
+import org.apache.blur.thrift.BlurClient;
+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;
+import org.apache.blur.thrift.generated.Blur.Iface;
+
+
+public class LoadData {
+
+  private static Random random = new Random();
+  private static List<String> words = new ArrayList<String>();
+
+  public static void main(String[] args) throws BlurException, TException, IOException {
+    loadWords();
+    final boolean wal = true;
+    final int numberOfColumns = 3;
+    int numberRows = 100000;
+    final int numberRecordsPerRow = 3;
+    final int numberOfFamilies = 3;
+    final int numberOfWords = 30;
+    int count = 0;
+    int max = 100;
+    long start = System.currentTimeMillis();
+    final String table = args[1];
+    for (int i = 0; i < numberRows; i++) {
+      if (count >= max) {
+        double seconds = (System.currentTimeMillis() - start) / 1000.0;
+        double rate = i / seconds;
+        System.out.println("Rows indexed [" + i + "] at [" + rate + "/s]");
+        count = 0;
+      }
+
+      Iface client = BlurClient.getClient(args[0]);
+      RowMutation mutation = new RowMutation();
+      mutation.setTable(table);
+      String rowId = getRowId();
+      mutation.setRowId(rowId);
+      mutation.setWal(wal);
+      mutation.setRowMutationType(RowMutationType.REPLACE_ROW);
+      for (int j = 0; j < numberRecordsPerRow; j++) {
+        mutation.addToRecordMutations(getRecordMutation(numberOfColumns, numberOfFamilies, numberOfWords));
+      }
+      client.mutate(mutation);
+      count++;
+    }
+  }
+
+  private static void loadWords() throws IOException {
+    InputStream inputStream = LoadData.class.getResourceAsStream("words.txt");
+    BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
+    String word;
+    while ((word = reader.readLine()) != null) {
+      words.add(word.trim());
+    }
+    reader.close();
+  }
+
+  protected static RecordMutation getRecordMutation(int numberOfColumns, int numberOfFamilies, int numberOfWords) {
+    RecordMutation recordMutation = new RecordMutation();
+    recordMutation.setRecord(getRecord(numberOfColumns, numberOfFamilies, numberOfWords));
+    recordMutation.setRecordMutationType(RecordMutationType.REPLACE_ENTIRE_RECORD);
+    return recordMutation;
+  }
+
+  private static Record getRecord(int numberOfColumns, int numberOfFamilies, int numberOfWords) {
+    Record record = new Record();
+    record.setRecordId(getRowId());
+    record.setFamily(getFamily(numberOfFamilies));
+    for (int i = 0; i < numberOfColumns; i++) {
+      record.addToColumns(new Column("col" + i, getWords(numberOfWords)));
+    }
+    return record;
+  }
+
+  private static String getWords(int numberOfWords) {
+    StringBuilder builder = new StringBuilder();
+    for (int i = 0; i < numberOfWords; i++) {
+      if (i != 0) {
+        builder.append(' ');
+      }
+      builder.append(getWord());
+    }
+    return builder.toString();
+  }
+
+  private static String getFamily(int numberOfFamilies) {
+    return "fam" + random.nextInt(numberOfFamilies);
+  }
+
+  private static String getWord() {
+    return words.get(random.nextInt(words.size()));
+  }
+
+  protected static String getRowId() {
+    return Long.toString(Math.abs(random.nextLong())) + "-" + Long.toString(Math.abs(random.nextLong()));
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b0e26648/blur-thrift/src/main/java/org/apache/blur/thrift/util/LoadDataAsync.java
----------------------------------------------------------------------
diff --git a/blur-thrift/src/main/java/org/apache/blur/thrift/util/LoadDataAsync.java b/blur-thrift/src/main/java/org/apache/blur/thrift/util/LoadDataAsync.java
new file mode 100644
index 0000000..5d1ad74
--- /dev/null
+++ b/blur-thrift/src/main/java/org/apache/blur/thrift/util/LoadDataAsync.java
@@ -0,0 +1,146 @@
+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.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+
+import org.apache.blur.thirdparty.thrift_0_9_0.TException;
+import org.apache.blur.thirdparty.thrift_0_9_0.async.AsyncMethodCallback;
+import org.apache.blur.thrift.AsyncClientPool;
+import org.apache.blur.thrift.generated.Blur;
+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;
+import org.apache.blur.thrift.generated.Blur.AsyncIface;
+import org.apache.blur.thrift.generated.Blur.AsyncClient.mutate_call;
+
+
+public class LoadDataAsync {
+
+  private static Random random = new Random();
+  private static List<String> words = new ArrayList<String>();
+
+  public static void main(String[] args) throws BlurException, TException, IOException {
+    loadWords();
+    final boolean wal = false;
+    final int numberOfColumns = 3;
+    int numberRows = 100000;
+    final int numberRecordsPerRow = 2;
+    final int numberOfFamilies = 3;
+    final int numberOfWords = 30;
+    int count = 0;
+    int max = 100;
+    long start = System.currentTimeMillis();
+    final String table = "test-table";
+    AsyncClientPool pool = new AsyncClientPool();
+    AsyncIface client = pool.getClient(Blur.AsyncIface.class, args[0]);
+    for (int i = 0; i < numberRows; i++) {
+      if (count >= max) {
+        double seconds = (System.currentTimeMillis() - start) / 1000.0;
+        double rate = i / seconds;
+        System.out.println("Rows indexed [" + i + "] at [" + rate + "/s]");
+        count = 0;
+      }
+      client.mutate(getRowMutation(table, wal, numberRecordsPerRow, numberOfColumns, numberOfFamilies, numberOfWords), new AsyncMethodCallback<Blur.AsyncClient.mutate_call>() {
+        @Override
+        public void onError(Exception exception) {
+
+        }
+
+        @Override
+        public void onComplete(mutate_call response) {
+
+        }
+      });
+      count++;
+    }
+  }
+
+  private static RowMutation getRowMutation(String table, boolean wal, int numberRecordsPerRow, int numberOfColumns, int numberOfFamilies, int numberOfWords) {
+    RowMutation mutation = new RowMutation();
+    mutation.setTable(table);
+    String rowId = getRowId();
+    mutation.setRowId(rowId);
+    mutation.setWal(wal);
+    mutation.setRowMutationType(RowMutationType.REPLACE_ROW);
+    for (int j = 0; j < numberRecordsPerRow; j++) {
+      mutation.addToRecordMutations(getRecordMutation(numberOfColumns, numberOfFamilies, numberOfWords));
+    }
+    return mutation;
+  }
+
+  private static void loadWords() throws IOException {
+    InputStream inputStream = LoadDataAsync.class.getResourceAsStream("words.txt");
+    BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
+    String word;
+    while ((word = reader.readLine()) != null) {
+      words.add(word.trim());
+    }
+    reader.close();
+  }
+
+  protected static RecordMutation getRecordMutation(int numberOfColumns, int numberOfFamilies, int numberOfWords) {
+    RecordMutation recordMutation = new RecordMutation();
+    recordMutation.setRecord(getRecord(numberOfColumns, numberOfFamilies, numberOfWords));
+    recordMutation.setRecordMutationType(RecordMutationType.REPLACE_ENTIRE_RECORD);
+    return recordMutation;
+  }
+
+  private static Record getRecord(int numberOfColumns, int numberOfFamilies, int numberOfWords) {
+    Record record = new Record();
+    record.setRecordId(getRowId());
+    record.setFamily(getFamily(numberOfFamilies));
+    for (int i = 0; i < numberOfColumns; i++) {
+      record.addToColumns(new Column("col" + i, getWords(numberOfWords)));
+    }
+    return record;
+  }
+
+  private static String getWords(int numberOfWords) {
+    StringBuilder builder = new StringBuilder();
+    for (int i = 0; i < numberOfWords; i++) {
+      if (i != 0) {
+        builder.append(' ');
+      }
+      builder.append(getWord());
+    }
+    return builder.toString();
+  }
+
+  private static String getFamily(int numberOfFamilies) {
+    return "fam" + random.nextInt(numberOfFamilies);
+  }
+
+  private static String getWord() {
+    return words.get(random.nextInt(words.size()));
+  }
+
+  protected static String getRowId() {
+    return Long.toString(Math.abs(random.nextLong())) + "-" + Long.toString(Math.abs(random.nextLong()));
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b0e26648/blur-thrift/src/main/java/org/apache/blur/thrift/util/LoadDataAsyncContinuously.java
----------------------------------------------------------------------
diff --git a/blur-thrift/src/main/java/org/apache/blur/thrift/util/LoadDataAsyncContinuously.java b/blur-thrift/src/main/java/org/apache/blur/thrift/util/LoadDataAsyncContinuously.java
new file mode 100644
index 0000000..5bb6a7b
--- /dev/null
+++ b/blur-thrift/src/main/java/org/apache/blur/thrift/util/LoadDataAsyncContinuously.java
@@ -0,0 +1,154 @@
+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.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+
+import org.apache.blur.thirdparty.thrift_0_9_0.TException;
+import org.apache.blur.thirdparty.thrift_0_9_0.async.AsyncMethodCallback;
+import org.apache.blur.thrift.AsyncClientPool;
+import org.apache.blur.thrift.generated.Blur;
+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;
+import org.apache.blur.thrift.generated.Blur.AsyncIface;
+import org.apache.blur.thrift.generated.Blur.AsyncClient.mutate_call;
+
+
+public class LoadDataAsyncContinuously {
+
+  private static Random random = new Random();
+  private static List<String> words = new ArrayList<String>();
+
+  public static void main(String[] args) throws BlurException, TException, IOException {
+    loadWords();
+    while (true) {
+      final boolean wal = true;
+      final int numberOfColumns = 3;
+      int numberRows = 100000;
+      final int numberRecordsPerRow = 2;
+      final int numberOfFamilies = 3;
+      final int numberOfWords = 30;
+      int count = 0;
+      int max = 1000;
+      long start = System.currentTimeMillis();
+      final String table = "test1";
+      AsyncClientPool pool = new AsyncClientPool();
+      AsyncIface client = pool.getClient(Blur.AsyncIface.class, args[0]);
+      for (int i = 0; i < numberRows; i++) {
+        if (count >= max) {
+          double seconds = (System.currentTimeMillis() - start) / 1000.0;
+          double rate = i / seconds;
+          System.out.println("Rows indexed [" + i + "] at [" + rate + "/s]");
+          count = 0;
+        }
+        client.mutate(getRowMutation(i, table, wal, numberRecordsPerRow, numberOfColumns, numberOfFamilies, numberOfWords),
+            new AsyncMethodCallback<Blur.AsyncClient.mutate_call>() {
+              @Override
+              public void onError(Exception exception) {
+                exception.printStackTrace();
+              }
+
+              @Override
+              public void onComplete(mutate_call response) {
+                try {
+                  response.getResult();
+                } catch (BlurException e) {
+                  e.printStackTrace();
+                } catch (TException e) {
+                  e.printStackTrace();
+                }
+              }
+            });
+        count++;
+      }
+    }
+  }
+
+  private static RowMutation getRowMutation(int rowid, String table, boolean wal, int numberRecordsPerRow, int numberOfColumns, int numberOfFamilies, int numberOfWords) {
+    RowMutation mutation = new RowMutation();
+    mutation.setTable(table);
+    mutation.setRowId(Integer.toString(rowid));
+    mutation.setWal(wal);
+    mutation.setRowMutationType(RowMutationType.REPLACE_ROW);
+    for (int j = 0; j < numberRecordsPerRow; j++) {
+      mutation.addToRecordMutations(getRecordMutation(numberOfColumns, numberOfFamilies, numberOfWords));
+    }
+    return mutation;
+  }
+
+  private static void loadWords() throws IOException {
+    InputStream inputStream = LoadDataAsyncContinuously.class.getResourceAsStream("words.txt");
+    BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
+    String word;
+    while ((word = reader.readLine()) != null) {
+      words.add(word.trim());
+    }
+    reader.close();
+  }
+
+  protected static RecordMutation getRecordMutation(int numberOfColumns, int numberOfFamilies, int numberOfWords) {
+    RecordMutation recordMutation = new RecordMutation();
+    recordMutation.setRecord(getRecord(numberOfColumns, numberOfFamilies, numberOfWords));
+    recordMutation.setRecordMutationType(RecordMutationType.REPLACE_ENTIRE_RECORD);
+    return recordMutation;
+  }
+
+  private static Record getRecord(int numberOfColumns, int numberOfFamilies, int numberOfWords) {
+    Record record = new Record();
+    record.setRecordId(getRowId());
+    record.setFamily(getFamily(numberOfFamilies));
+    for (int i = 0; i < numberOfColumns; i++) {
+      record.addToColumns(new Column("col" + i, getWords(numberOfWords)));
+    }
+    return record;
+  }
+
+  private static String getWords(int numberOfWords) {
+    StringBuilder builder = new StringBuilder();
+    for (int i = 0; i < numberOfWords; i++) {
+      if (i != 0) {
+        builder.append(' ');
+      }
+      builder.append(getWord());
+    }
+    return builder.toString();
+  }
+
+  private static String getFamily(int numberOfFamilies) {
+    return "fam" + random.nextInt(numberOfFamilies);
+  }
+
+  private static String getWord() {
+    return words.get(random.nextInt(words.size()));
+  }
+
+  protected static String getRowId() {
+    return Long.toString(Math.abs(random.nextLong())) + "-" + Long.toString(Math.abs(random.nextLong()));
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b0e26648/blur-thrift/src/main/java/org/apache/blur/thrift/util/LoadDataContinuously.java
----------------------------------------------------------------------
diff --git a/blur-thrift/src/main/java/org/apache/blur/thrift/util/LoadDataContinuously.java b/blur-thrift/src/main/java/org/apache/blur/thrift/util/LoadDataContinuously.java
new file mode 100644
index 0000000..ec396bc
--- /dev/null
+++ b/blur-thrift/src/main/java/org/apache/blur/thrift/util/LoadDataContinuously.java
@@ -0,0 +1,174 @@
+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.BufferedReader;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.blur.thirdparty.thrift_0_9_0.TException;
+import org.apache.blur.thrift.BlurClient;
+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;
+import org.apache.blur.thrift.generated.Blur.Iface;
+
+
+public class LoadDataContinuously {
+
+  private static Random random = new Random();
+  public static List<String> words = new ArrayList<String>();
+
+  public static void main(String[] args) throws BlurException, TException, IOException {
+    if (!(args.length == 8 || args.length == 9)) {
+      System.err
+          .println(LoadDataContinuously.class.getName()
+              + " <host1:port1,host2:port2> <table name> <WAL true|false> <# of columns per record> <# of records per row> <# of column families> <# of words per record> <time in seconds between reporting progress> <*optional path to word dictionary>");
+      System.exit(1);
+    }
+    if (args.length == 9) {
+      loadWords(args[8]);
+    } else {
+      loadWords(null);
+    }
+
+    final Iface client = BlurClient.getClient(args[0]);
+    final String table = args[1];
+    final boolean wal = Boolean.parseBoolean(args[2]);
+    final int numberOfColumns = Integer.parseInt(args[3]);
+    final int numberRecordsPerRow = Integer.parseInt(args[4]);
+    final int numberOfFamilies = Integer.parseInt(args[5]);
+    final int numberOfWords = Integer.parseInt(args[6]);
+    final long timeBetweenReporting = TimeUnit.SECONDS.toMillis(Integer.parseInt(args[7]));
+    final long start = System.currentTimeMillis();
+
+    long s = start;
+    long recordCountTotal = 0;
+    long rowCount = 0;
+
+    int batchSize = 100;
+
+    List<RowMutation> batch = new ArrayList<RowMutation>();
+
+    long recordCount = 0;
+    long totalTime = 0;
+    long calls = 0;
+    while (true) {
+      long now = System.currentTimeMillis();
+      if (s + timeBetweenReporting < now) {
+        double avgSeconds = (now - start) / 1000.0;
+        double seconds = (now - s) / 1000.0;
+        double avgRate = recordCountTotal / avgSeconds;
+        double rate = recordCount / seconds;
+        double latency = (totalTime / 1000000.0) / calls;
+        System.out.println(System.currentTimeMillis() + "," + recordCountTotal + "," + rowCount + "," + latency + "," + rate + "," + avgRate);
+        s = now;
+        recordCount = 0;
+        totalTime = 0;
+        calls = 0;
+      }
+
+      RowMutation mutation = new RowMutation();
+      mutation.setTable(table);
+      String rowId = getRowId();
+      mutation.setRowId(rowId);
+      mutation.setWal(wal);
+      mutation.setRowMutationType(RowMutationType.REPLACE_ROW);
+      for (int j = 0; j < numberRecordsPerRow; j++) {
+        mutation.addToRecordMutations(getRecordMutation(numberOfColumns, numberOfFamilies, numberOfWords));
+      }
+      batch.add(mutation);
+      if (batch.size() >= batchSize) {
+        long sm = System.nanoTime();
+        client.mutateBatch(batch);
+        long em = System.nanoTime();
+        calls++;
+        totalTime += (em - sm);
+        batch.clear();
+      }
+      rowCount++;
+      recordCount += numberRecordsPerRow;
+      recordCountTotal += numberRecordsPerRow;
+    }
+  }
+
+  public static void loadWords(String path) throws IOException {
+    InputStream inputStream;
+    if (path == null) {
+      inputStream = LoadDataContinuously.class.getResourceAsStream("words.txt");
+    } else {
+      inputStream = new FileInputStream(path);
+    }
+    BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
+    String word;
+    while ((word = reader.readLine()) != null) {
+      words.add(word.trim());
+    }
+    reader.close();
+  }
+
+  protected static RecordMutation getRecordMutation(int numberOfColumns, int numberOfFamilies, int numberOfWords) {
+    RecordMutation recordMutation = new RecordMutation();
+    recordMutation.setRecord(getRecord(numberOfColumns, numberOfFamilies, numberOfWords));
+    recordMutation.setRecordMutationType(RecordMutationType.REPLACE_ENTIRE_RECORD);
+    return recordMutation;
+  }
+
+  private static Record getRecord(int numberOfColumns, int numberOfFamilies, int numberOfWords) {
+    Record record = new Record();
+    record.setRecordId(getRowId());
+    record.setFamily(getFamily(numberOfFamilies));
+    for (int i = 0; i < numberOfColumns; i++) {
+      record.addToColumns(new Column("col" + i, getWords(numberOfWords)));
+    }
+    return record;
+  }
+
+  private static String getWords(int numberOfWords) {
+    StringBuilder builder = new StringBuilder();
+    for (int i = 0; i < numberOfWords; i++) {
+      if (i != 0) {
+        builder.append(' ');
+      }
+      builder.append(getWord());
+    }
+    return builder.toString();
+  }
+
+  private static String getFamily(int numberOfFamilies) {
+    return "fam" + random.nextInt(numberOfFamilies);
+  }
+
+  private static String getWord() {
+    return words.get(random.nextInt(words.size()));
+  }
+
+  protected static String getRowId() {
+    return Long.toString(Math.abs(random.nextLong())) + "-" + Long.toString(Math.abs(random.nextLong()));
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b0e26648/blur-thrift/src/main/java/org/apache/blur/thrift/util/OptimizeTable.java
----------------------------------------------------------------------
diff --git a/blur-thrift/src/main/java/org/apache/blur/thrift/util/OptimizeTable.java b/blur-thrift/src/main/java/org/apache/blur/thrift/util/OptimizeTable.java
new file mode 100644
index 0000000..4a47e9e
--- /dev/null
+++ b/blur-thrift/src/main/java/org/apache/blur/thrift/util/OptimizeTable.java
@@ -0,0 +1,35 @@
+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.BlurException;
+import org.apache.blur.thrift.generated.Blur.Iface;
+
+
+public class OptimizeTable {
+
+  public static void main(String[] args) throws BlurException, TException, IOException {
+    final String tableName = args[1];
+    final int segmentCount = Integer.parseInt(args[2]);
+    Iface client = BlurClient.getClient(args[0]);
+    client.optimize(tableName, segmentCount);
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b0e26648/blur-thrift/src/main/java/org/apache/blur/thrift/util/RandomSearchTable.java
----------------------------------------------------------------------
diff --git a/blur-thrift/src/main/java/org/apache/blur/thrift/util/RandomSearchTable.java b/blur-thrift/src/main/java/org/apache/blur/thrift/util/RandomSearchTable.java
new file mode 100644
index 0000000..5b59bc3
--- /dev/null
+++ b/blur-thrift/src/main/java/org/apache/blur/thrift/util/RandomSearchTable.java
@@ -0,0 +1,120 @@
+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 java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Random;
+import java.util.Set;
+
+import org.apache.blur.thirdparty.thrift_0_9_0.TException;
+import org.apache.blur.thrift.BlurClient;
+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.Schema;
+import org.apache.blur.thrift.generated.SimpleQuery;
+import org.apache.blur.thrift.generated.Blur.Iface;
+
+
+public class RandomSearchTable {
+
+  public static void main(String[] args) throws BlurException, TException, IOException {
+    String connectionStr = args[0];
+    final String tableName = args[1];
+    int numberOfTerms = Integer.parseInt(args[2]);
+    int numberOfSearchesPerPass = Integer.parseInt(args[3]);
+    int numberOfTermsPerQuery = Integer.parseInt(args[4]);
+    List<String> sampleOfTerms = getSampleOfTerms(connectionStr, tableName, numberOfTerms);
+    // for (String term : sampleOfTerms) {
+    // System.out.println(term);
+    // }
+    runSearches(connectionStr, tableName, sampleOfTerms, numberOfSearchesPerPass, numberOfTermsPerQuery);
+  }
+
+  private static void runSearches(String connectionStr, final String tableName, List<String> sampleOfTerms, int numberOfSearchesPerPass, int numberOfTermsPerQuery)
+      throws BlurException, TException, IOException {
+    Random random = new Random();
+    StringBuilder builder = new StringBuilder();
+    for (int i = 0; i < numberOfSearchesPerPass; i++) {
+
+      builder.setLength(0);
+      String query = generateQuery(builder, random, sampleOfTerms, numberOfTermsPerQuery);
+      System.out.println(query);
+      final BlurQuery blurQuery = new BlurQuery();
+      blurQuery.simpleQuery = new SimpleQuery();
+      blurQuery.simpleQuery.queryStr = query;
+      long start = System.nanoTime();
+
+      Iface client = BlurClient.getClient(connectionStr);
+      BlurResults results = client.query(tableName, blurQuery);
+      long end = System.nanoTime();
+      System.out.println((end - start) / 1000000.0 + " ms " + results.totalResults);
+    }
+  }
+
+  private static String generateQuery(StringBuilder builder, Random random, List<String> sampleOfTerms, int numberOfTermsPerQuery) {
+    for (int i = 0; i < numberOfTermsPerQuery; i++) {
+      builder.append(getRandomTerm(sampleOfTerms, random)).append(' ');
+    }
+    return builder.toString().trim();
+  }
+
+  private static String getRandomTerm(List<String> sampleOfTerms, Random random) {
+    int index = random.nextInt(sampleOfTerms.size());
+    return sampleOfTerms.get(index);
+  }
+
+  private static List<String> getSampleOfTerms(String connectionStr, String tableName, int numberOfTerms) throws BlurException, TException, IOException {
+    List<String> sampleOfTerms = new ArrayList<String>();
+    Set<String> fields = getFields(connectionStr, tableName);
+    for (String field : fields) {
+      Set<String> randomSampleOfTerms = getRandomSampleOfTerms(connectionStr, tableName, field, numberOfTerms);
+      for (String term : randomSampleOfTerms) {
+        sampleOfTerms.add(field + ":" + term);
+      }
+    }
+    Collections.shuffle(sampleOfTerms);
+    return sampleOfTerms;
+  }
+
+  private static Set<String> getRandomSampleOfTerms(String connectionStr, final String tableName, final String field, final int numberOfTerms) throws BlurException, TException,
+      IOException {
+    Iface client = BlurClient.getClient(connectionStr);
+    String[] split = field.split("\\.");
+    String columnFamily = split[0];
+    String columnName = split[1];
+    List<String> terms = client.terms(tableName, columnFamily, columnName, "", (short) numberOfTerms);
+    return new HashSet<String>(terms);
+  }
+
+  private static Set<String> getFields(String connectionStr, final String tableName) throws BlurException, TException, IOException {
+    Iface client = BlurClient.getClient(connectionStr);
+    Schema schema = client.schema(tableName);
+    Set<String> fields = new HashSet<String>();
+    for (String cf : schema.columnFamilies.keySet()) {
+      for (String field : schema.columnFamilies.get(cf)) {
+        fields.add(cf + "." + field);
+      }
+    }
+    return fields;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b0e26648/blur-thrift/src/main/java/org/apache/blur/thrift/util/RandomSearchTableContinuously.java
----------------------------------------------------------------------
diff --git a/blur-thrift/src/main/java/org/apache/blur/thrift/util/RandomSearchTableContinuously.java b/blur-thrift/src/main/java/org/apache/blur/thrift/util/RandomSearchTableContinuously.java
new file mode 100644
index 0000000..03c3839
--- /dev/null
+++ b/blur-thrift/src/main/java/org/apache/blur/thrift/util/RandomSearchTableContinuously.java
@@ -0,0 +1,161 @@
+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 java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Random;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.blur.thirdparty.thrift_0_9_0.TException;
+import org.apache.blur.thrift.BlurClient;
+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.Schema;
+import org.apache.blur.thrift.generated.Selector;
+import org.apache.blur.thrift.generated.SimpleQuery;
+import org.apache.blur.thrift.generated.Blur.Iface;
+
+
+public class RandomSearchTableContinuously {
+
+  public static void main(String[] args) throws BlurException, TException, IOException {
+    if (args.length != 6) {
+      System.err
+          .println(RandomSearchTableContinuously.class.getName()
+              + " <host1:port1,host2:port2> <table name> <# of terms to load into memory per pass> <# of searches per pass> <# of terms per query> <time in seconds between reporting progress>");
+      System.exit(1);
+    }
+    final String connectionStr = args[0];
+    final String tableName = args[1];
+    final int numberOfTerms = Integer.parseInt(args[2]);
+    final int numberOfSearchesPerPass = Integer.parseInt(args[3]);
+    final int numberOfTermsPerQuery = Integer.parseInt(args[4]);
+    final long timeBetweenReporting = TimeUnit.SECONDS.toMillis(Integer.parseInt(args[5]));
+    List<String> sampleOfTerms = getSampleOfTerms(connectionStr, tableName, numberOfTerms);
+    while (true) {
+      runSearches(connectionStr, tableName, sampleOfTerms, numberOfSearchesPerPass, numberOfTermsPerQuery, timeBetweenReporting);
+    }
+  }
+
+  private static void runSearches(String connectionStr, final String tableName, List<String> sampleOfTerms, int numberOfSearchesPerPass, int numberOfTermsPerQuery,
+      long timeBetweenReporting) throws BlurException, TException, IOException {
+    Random random = new Random();
+    StringBuilder builder = new StringBuilder();
+    final long start = System.currentTimeMillis();
+    long s = start;
+    long responseTime = 0;
+    int count = 0;
+    long resultCount = 0;
+    Iface client = BlurClient.getClient(connectionStr);
+    int i;
+    for (i = 0; i < numberOfSearchesPerPass; i++) {
+      long now = System.currentTimeMillis();
+      if (s + timeBetweenReporting < now) {
+        double avgSeconds = (now - start) / 1000.0;
+        double seconds = (now - s) / 1000.0;
+        double avgRate = i / avgSeconds;
+        double rate = count / seconds;
+        double responseTimeAvg = (responseTime / (double) count) / 1000000.0;
+        System.out.println(System.currentTimeMillis() + "," + i + "," + responseTimeAvg + "," + rate + "," + avgRate + "," + resultCount + "," + getCount(client, tableName));
+        s = now;
+        responseTime = 0;
+        count = 0;
+        resultCount = 0;
+      }
+
+      builder.setLength(0);
+      String query = generateQuery(builder, random, sampleOfTerms, numberOfTermsPerQuery);
+      final BlurQuery blurQuery = new BlurQuery();
+      blurQuery.simpleQuery = new SimpleQuery();
+      blurQuery.simpleQuery.queryStr = query;
+      blurQuery.cacheResult = false;
+      blurQuery.selector = new Selector();
+      long qs = System.nanoTime();
+
+      BlurResults results = client.query(tableName, blurQuery);
+      long qe = System.nanoTime();
+      resultCount += results.totalResults;
+      responseTime += (qe - qs);
+      count++;
+    }
+  }
+
+  private static long getCount(Iface client, String tableName) throws BlurException, TException {
+    BlurQuery bq = new BlurQuery();
+    bq.simpleQuery = new SimpleQuery();
+    bq.simpleQuery.queryStr = "*";
+    bq.simpleQuery.superQueryOn = false;
+    bq.cacheResult = false;
+    bq.useCacheIfPresent = false;
+    BlurResults results = client.query(tableName, bq);
+    return results.totalResults;
+  }
+
+  private static String generateQuery(StringBuilder builder, Random random, List<String> sampleOfTerms, int numberOfTermsPerQuery) {
+    for (int i = 0; i < numberOfTermsPerQuery; i++) {
+      builder.append(getRandomTerm(sampleOfTerms, random)).append(' ');
+    }
+    return builder.toString().trim();
+  }
+
+  private static String getRandomTerm(List<String> sampleOfTerms, Random random) {
+    int index = random.nextInt(sampleOfTerms.size());
+    return sampleOfTerms.get(index);
+  }
+
+  private static List<String> getSampleOfTerms(String connectionStr, String tableName, int numberOfTerms) throws BlurException, TException, IOException {
+    List<String> sampleOfTerms = new ArrayList<String>();
+    Set<String> fields = getFields(connectionStr, tableName);
+    for (String field : fields) {
+      Set<String> randomSampleOfTerms = getRandomSampleOfTerms(connectionStr, tableName, field, numberOfTerms);
+      for (String term : randomSampleOfTerms) {
+        sampleOfTerms.add(field + ":" + term);
+      }
+    }
+    Collections.shuffle(sampleOfTerms);
+    return sampleOfTerms;
+  }
+
+  private static Set<String> getRandomSampleOfTerms(String connectionStr, final String tableName, final String field, final int numberOfTerms) throws BlurException, TException,
+      IOException {
+    Iface client = BlurClient.getClient(connectionStr);
+    String[] split = field.split("\\.");
+    String columnFamily = split[0];
+    String columnName = split[1];
+    List<String> terms = client.terms(tableName, columnFamily, columnName, "", (short) numberOfTerms);
+    return new HashSet<String>(terms);
+  }
+
+  private static Set<String> getFields(String connectionStr, final String tableName) throws BlurException, TException, IOException {
+    Iface client = BlurClient.getClient(connectionStr);
+    Schema schema = client.schema(tableName);
+    Set<String> fields = new HashSet<String>();
+    for (String cf : schema.columnFamilies.keySet()) {
+      for (String field : schema.columnFamilies.get(cf)) {
+        fields.add(cf + "." + field);
+      }
+    }
+    return fields;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b0e26648/blur-thrift/src/main/java/org/apache/blur/thrift/util/RapidlyCreateAndDeleteTables.java
----------------------------------------------------------------------
diff --git a/blur-thrift/src/main/java/org/apache/blur/thrift/util/RapidlyCreateAndDeleteTables.java b/blur-thrift/src/main/java/org/apache/blur/thrift/util/RapidlyCreateAndDeleteTables.java
new file mode 100644
index 0000000..01de46d
--- /dev/null
+++ b/blur-thrift/src/main/java/org/apache/blur/thrift/util/RapidlyCreateAndDeleteTables.java
@@ -0,0 +1,91 @@
+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 static org.apache.blur.thrift.util.BlurThriftHelper.newColumn;
+import static org.apache.blur.thrift.util.BlurThriftHelper.newRecordMutation;
+
+import java.util.Random;
+import java.util.UUID;
+
+import org.apache.blur.thirdparty.thrift_0_9_0.TException;
+import org.apache.blur.thrift.BlurClient;
+import org.apache.blur.thrift.generated.AnalyzerDefinition;
+import org.apache.blur.thrift.generated.Blur.Iface;
+import org.apache.blur.thrift.generated.BlurException;
+import org.apache.blur.thrift.generated.RowMutation;
+import org.apache.blur.thrift.generated.RowMutationType;
+import org.apache.blur.thrift.generated.TableDescriptor;
+public class RapidlyCreateAndDeleteTables {
+
+  public static void main(String[] args) throws BlurException, TException {
+    String connectionStr = args[0];
+    final String cluster = args[1];
+    String uri = args[2];
+    int shardCount = 1;
+    Iface client = BlurClient.getClient(connectionStr);
+    while (true) {
+      String tableName = UUID.randomUUID().toString();
+      System.out.println("Creating [" + tableName + "]");
+      boolean readOnly = createTable(client, cluster, uri, shardCount, tableName);
+      if (!readOnly) {
+        System.out.println("Loading [" + tableName + "]");
+        loadTable(client, tableName);
+      }
+      System.out.println("Disabling [" + tableName + "]");
+      disable(client, tableName);
+      System.out.println("Removing [" + tableName + "]");
+      delete(client, tableName);
+    }
+  }
+
+  private static void disable(Iface client, String tableName) throws BlurException, TException {
+    client.disableTable(tableName);
+  }
+
+  private static void delete(Iface client, String tableName) throws BlurException, TException {
+    client.removeTable(tableName, true);
+  }
+
+  private static void loadTable(Iface client, String tableName) throws BlurException, TException {
+    RowMutation mutation = new RowMutation();
+    mutation.table = tableName;
+    mutation.waitToBeVisible = true;
+    mutation.rowId = "test";
+    mutation.addToRecordMutations(newRecordMutation("test", "test", newColumn("test", "test")));
+    mutation.rowMutationType = RowMutationType.REPLACE_ROW;
+    client.mutate(mutation);
+  }
+
+  private static boolean createTable(Iface client, final String cluster, String uri, int shardCount, String tableName) throws BlurException, TException {
+    Random random = new Random();
+    final TableDescriptor tableDescriptor = new TableDescriptor();
+    tableDescriptor.analyzerDefinition = new AnalyzerDefinition();
+    tableDescriptor.cluster = cluster;
+
+    tableDescriptor.name = tableName;
+    tableDescriptor.readOnly = random.nextBoolean();
+
+    tableDescriptor.shardCount = shardCount;
+    tableDescriptor.tableUri = uri + "/" + tableName;
+
+    client.createTable(tableDescriptor);
+
+    return tableDescriptor.readOnly;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b0e26648/blur-thrift/src/main/java/org/apache/blur/thrift/util/RemoveTable.java
----------------------------------------------------------------------
diff --git a/blur-thrift/src/main/java/org/apache/blur/thrift/util/RemoveTable.java b/blur-thrift/src/main/java/org/apache/blur/thrift/util/RemoveTable.java
new file mode 100644
index 0000000..0c51b23
--- /dev/null
+++ b/blur-thrift/src/main/java/org/apache/blur/thrift/util/RemoveTable.java
@@ -0,0 +1,36 @@
+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.BlurException;
+import org.apache.blur.thrift.generated.Blur.Iface;
+
+
+public class RemoveTable {
+
+  public static void main(String[] args) throws BlurException, TException, IOException {
+    String connectionStr = args[0];
+    final String tableName = args[1];
+
+    Iface client = BlurClient.getClient(connectionStr);
+    client.removeTable(tableName, true);
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b0e26648/blur-thrift/src/main/java/org/apache/blur/thrift/util/ShardServerLayoutStateTables.java
----------------------------------------------------------------------
diff --git a/blur-thrift/src/main/java/org/apache/blur/thrift/util/ShardServerLayoutStateTables.java b/blur-thrift/src/main/java/org/apache/blur/thrift/util/ShardServerLayoutStateTables.java
new file mode 100644
index 0000000..ff19628
--- /dev/null
+++ b/blur-thrift/src/main/java/org/apache/blur/thrift/util/ShardServerLayoutStateTables.java
@@ -0,0 +1,51 @@
+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 java.util.Map;
+import java.util.Map.Entry;
+
+import org.apache.blur.thirdparty.thrift_0_9_0.TException;
+import org.apache.blur.thrift.BlurClient;
+import org.apache.blur.thrift.generated.BlurException;
+import org.apache.blur.thrift.generated.Blur.Iface;
+import org.apache.blur.thrift.generated.ShardState;
+
+public class ShardServerLayoutStateTables {
+
+  public static void main(String[] args) throws BlurException, TException, IOException, InterruptedException {
+    String connectionStr = args[0];
+
+    Iface client = BlurClient.getClient(connectionStr);
+    System.out.println(client.tableList());
+
+    while (true) {
+      System.out.println("===============");
+      for (String table : client.tableList()) {
+        Map<String, Map<String, ShardState>> state = client.shardServerLayoutState(table);
+        for (String shard : state.keySet()) {
+          Map<String, ShardState> shardMap = state.get(shard);
+          for (Entry<String, ShardState> entry : shardMap.entrySet()) {
+            System.out.println(shard + " " + entry.getKey() + " " + entry.getValue());
+          }
+        }
+      }
+      Thread.sleep(1000);
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b0e26648/blur-thrift/src/main/java/org/apache/blur/thrift/util/SimpleQueryExample.java
----------------------------------------------------------------------
diff --git a/blur-thrift/src/main/java/org/apache/blur/thrift/util/SimpleQueryExample.java b/blur-thrift/src/main/java/org/apache/blur/thrift/util/SimpleQueryExample.java
new file mode 100644
index 0000000..bcf6921
--- /dev/null
+++ b/blur-thrift/src/main/java/org/apache/blur/thrift/util/SimpleQueryExample.java
@@ -0,0 +1,50 @@
+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 SimpleQueryExample {
+
+  public static void main(String[] args) throws BlurException, TException, IOException {
+    String connectionStr = args[0];
+    String tableName = args[1];
+    String query = args[2];
+
+    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/b0e26648/blur-thrift/src/main/java/org/apache/blur/thrift/util/StatsTable.java
----------------------------------------------------------------------
diff --git a/blur-thrift/src/main/java/org/apache/blur/thrift/util/StatsTable.java b/blur-thrift/src/main/java/org/apache/blur/thrift/util/StatsTable.java
new file mode 100644
index 0000000..1025445
--- /dev/null
+++ b/blur-thrift/src/main/java/org/apache/blur/thrift/util/StatsTable.java
@@ -0,0 +1,38 @@
+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.BlurException;
+import org.apache.blur.thrift.generated.Blur.Iface;
+import org.apache.blur.thrift.generated.TableStats;
+
+
+public class StatsTable {
+
+  public static void main(String[] args) throws BlurException, TException, IOException {
+    String connectionStr = args[0];
+    final String tableName = args[1];
+
+    Iface client = BlurClient.getClient(connectionStr);
+    TableStats tableStats = client.getTableStats(tableName);
+    System.out.println(tableStats);
+  }
+}


Mime
View raw message