@Test public void testFetchRowByRowIdBatch() throws Exception { List<Selector> selectors = new ArrayList<Selector>(); selectors.add(new Selector().setRowId("row-1")); selectors.add(new Selector().setRowId("row-2")); List<FetchResult> fetchRowBatch = indexManager.fetchRowBatch(TABLE, selectors); assertEquals(2, fetchRowBatch.size()); FetchResult fetchResult1 = fetchRowBatch.get(0); assertNotNull(fetchResult1.rowResult.row); Row row1 = newRow( "row-1", newRecord(FAMILY, "record-1", newColumn("testcol1", "value1"), newColumn("testcol2", "value2"), newColumn("testcol3", "value3"))); FetchRowResult rowResult1 = fetchResult1.getRowResult(); assertEquals(row1, rowResult1.getRow()); assertEquals(1, rowResult1.getTotalRecords()); FetchResult fetchResult2 = fetchRowBatch.get(1); assertNotNull(fetchResult2.rowResult.row); Row row2 = newRow( "row-2", newRecord(FAMILY, "record-2", newColumn("testcol1", "value4"), newColumn("testcol2", "value5"), newColumn("testcol3", "value6")), newRecord(FAMILY, "record-2B", newColumn("testcol2", "value234123"), newColumn("testcol3", "value234123"))); FetchRowResult rowResult2 = fetchResult2.getRowResult(); assertEquals(row2, rowResult2.getRow()); assertEquals(2, rowResult2.getTotalRecords()); }
public List<FetchResult> fetchRowBatch(final String table, List<Selector> selectors) throws BlurException { List<Future<FetchResult>> futures = new ArrayList<Future<FetchResult>>(); for (Selector s : selectors) { final Selector selector = s; futures.add(_executor.submit(new Callable<FetchResult>() { @Override public FetchResult call() throws Exception { FetchResult fetchResult = new FetchResult(); fetchRow(table, selector, fetchResult); return fetchResult; } })); } List<FetchResult> results = new ArrayList<FetchResult>(); for (Future<FetchResult> future : futures) { try { results.add(future.get()); } catch (InterruptedException e) { throw new BException("Unkown error while fetching batch table [{0}] selectors [{1}].", e, table, selectors); } catch (ExecutionException e) { throw new BException("Unkown error while fetching batch table [{0}] selectors [{1}].", e.getCause(), table, selectors); } } return results; }
IndexManager { public List<FetchResult> fetchRowBatch(final String table, List<Selector> selectors) throws BlurException { List<Future<FetchResult>> futures = new ArrayList<Future<FetchResult>>(); for (Selector s : selectors) { final Selector selector = s; futures.add(_executor.submit(new Callable<FetchResult>() { @Override public FetchResult call() throws Exception { FetchResult fetchResult = new FetchResult(); fetchRow(table, selector, fetchResult); return fetchResult; } })); } List<FetchResult> results = new ArrayList<FetchResult>(); for (Future<FetchResult> future : futures) { try { results.add(future.get()); } catch (InterruptedException e) { throw new BException("Unkown error while fetching batch table [{0}] selectors [{1}].", e, table, selectors); } catch (ExecutionException e) { throw new BException("Unkown error while fetching batch table [{0}] selectors [{1}].", e.getCause(), table, selectors); } } return results; } }
IndexManager { public List<FetchResult> fetchRowBatch(final String table, List<Selector> selectors) throws BlurException { List<Future<FetchResult>> futures = new ArrayList<Future<FetchResult>>(); for (Selector s : selectors) { final Selector selector = s; futures.add(_executor.submit(new Callable<FetchResult>() { @Override public FetchResult call() throws Exception { FetchResult fetchResult = new FetchResult(); fetchRow(table, selector, fetchResult); return fetchResult; } })); } List<FetchResult> results = new ArrayList<FetchResult>(); for (Future<FetchResult> future : futures) { try { results.add(future.get()); } catch (InterruptedException e) { throw new BException("Unkown error while fetching batch table [{0}] selectors [{1}].", e, table, selectors); } catch (ExecutionException e) { throw new BException("Unkown error while fetching batch table [{0}] selectors [{1}].", e.getCause(), table, selectors); } } return results; } IndexManager(IndexServer indexServer, ClusterStatus clusterStatus, BlurFilterCache filterCache,
      int maxHeapPerRowFetch, int fetchCount, int threadCount, int mutateThreadCount, int facetThreadCount,
      DeepPagingCache deepPagingCache, MemoryAllocationWatcher memoryAllocationWatcher, QueryStatusManager statusManager); }
IndexManager { public List<FetchResult> fetchRowBatch(final String table, List<Selector> selectors) throws BlurException { List<Future<FetchResult>> futures = new ArrayList<Future<FetchResult>>(); for (Selector s : selectors) { final Selector selector = s; futures.add(_executor.submit(new Callable<FetchResult>() { @Override public FetchResult call() throws Exception { FetchResult fetchResult = new FetchResult(); fetchRow(table, selector, fetchResult); return fetchResult; } })); } List<FetchResult> results = new ArrayList<FetchResult>(); for (Future<FetchResult> future : futures) { try { results.add(future.get()); } catch (InterruptedException e) { throw new BException("Unkown error while fetching batch table [{0}] selectors [{1}].", e, table, selectors); } catch (ExecutionException e) { throw new BException("Unkown error while fetching batch table [{0}] selectors [{1}].", e.getCause(), table, selectors); } } return results; } IndexManager(IndexServer indexServer, ClusterStatus clusterStatus, BlurFilterCache filterCache,
      int maxHeapPerRowFetch, int fetchCount, int threadCount, int mutateThreadCount, int facetThreadCount,
      DeepPagingCache deepPagingCache, MemoryAllocationWatcher memoryAllocationWatcher, QueryStatusManager statusManager); synchronized void close(); List<FetchResult> fetchRowBatch(final String table, List<Selector> selectors); void fetchRow(String table, Selector selector, FetchResult fetchResult); static void populateSelector(IndexSearcherCloseable searcher, String shardName, String table, Selector selector); static void validSelector(Selector selector); BlurResultIterable query(final String table, final BlurQuery blurQuery, AtomicLongArray facetedCounts); String parseQuery(String table, org.apache.blur.thrift.generated.Query simpleQuery); void cancelQuery(String table, String uuid); List<BlurQueryStatus> currentQueries(String table); BlurQueryStatus queryStatus(String table, String uuid); List<String> queryStatusIdList(String table); static void fetchRow(IndexReader reader, String table, String shard, Selector selector,
      FetchResult fetchResult, Query highlightQuery, int maxHeap, TableContext tableContext, Filter filter); static void fetchRow(IndexReader reader, String table, String shard, Selector selector,
      FetchResult fetchResult, Query highlightQuery, FieldManager fieldManager, int maxHeap, TableContext tableContext,
      Filter filter); static ResetableDocumentStoredFieldVisitor getFieldSelector(final Selector selector); IndexServer getIndexServer(); long recordFrequency(final String table, final String columnFamily, final String columnName, final String value); List<String> terms(final String table, final String columnFamily, final String columnName,
      final String startWith, final short size); static long recordFrequency(IndexReader reader, String columnFamily, String columnName, String value); static List<String> terms(IndexReader reader, FieldTypeDefinition typeDef, String columnFamily,
      String columnName, String startWith, short size); void mutate(final RowMutation mutation); void mutate(final List<RowMutation> mutations); void enqueue(List<RowMutation> mutations); static boolean resetExitableReader(IndexReader indexReader, AtomicBoolean running); void optimize(String table, int numberOfSegmentsPerShard); void enqueue(RowMutation mutation); void bulkMutateAdd(String table, String bulkId, RowMutation mutation); void bulkMutateFinish(Set<String> potentialTables, String bulkId, boolean apply, boolean blockUntilComplete); void bulkMutateAddMultiple(String table, String bulkId, List<RowMutation> rowMutations); }
IndexManager { public List<FetchResult> fetchRowBatch(final String table, List<Selector> selectors) throws BlurException { List<Future<FetchResult>> futures = new ArrayList<Future<FetchResult>>(); for (Selector s : selectors) { final Selector selector = s; futures.add(_executor.submit(new Callable<FetchResult>() { @Override public FetchResult call() throws Exception { FetchResult fetchResult = new FetchResult(); fetchRow(table, selector, fetchResult); return fetchResult; } })); } List<FetchResult> results = new ArrayList<FetchResult>(); for (Future<FetchResult> future : futures) { try { results.add(future.get()); } catch (InterruptedException e) { throw new BException("Unkown error while fetching batch table [{0}] selectors [{1}].", e, table, selectors); } catch (ExecutionException e) { throw new BException("Unkown error while fetching batch table [{0}] selectors [{1}].", e.getCause(), table, selectors); } } return results; } IndexManager(IndexServer indexServer, ClusterStatus clusterStatus, BlurFilterCache filterCache,
      int maxHeapPerRowFetch, int fetchCount, int threadCount, int mutateThreadCount, int facetThreadCount,
      DeepPagingCache deepPagingCache, MemoryAllocationWatcher memoryAllocationWatcher, QueryStatusManager statusManager); synchronized void close(); List<FetchResult> fetchRowBatch(final String table, List<Selector> selectors); void fetchRow(String table, Selector selector, FetchResult fetchResult); static void populateSelector(IndexSearcherCloseable searcher, String shardName, String table, Selector selector); static void validSelector(Selector selector); BlurResultIterable query(final String table, final BlurQuery blurQuery, AtomicLongArray facetedCounts); String parseQuery(String table, org.apache.blur.thrift.generated.Query simpleQuery); void cancelQuery(String table, String uuid); List<BlurQueryStatus> currentQueries(String table); BlurQueryStatus queryStatus(String table, String uuid); List<String> queryStatusIdList(String table); static void fetchRow(IndexReader reader, String table, String shard, Selector selector,
      FetchResult fetchResult, Query highlightQuery, int maxHeap, TableContext tableContext, Filter filter); static void fetchRow(IndexReader reader, String table, String shard, Selector selector,
      FetchResult fetchResult, Query highlightQuery, FieldManager fieldManager, int maxHeap, TableContext tableContext,
      Filter filter); static ResetableDocumentStoredFieldVisitor getFieldSelector(final Selector selector); IndexServer getIndexServer(); long recordFrequency(final String table, final String columnFamily, final String columnName, final String value); List<String> terms(final String table, final String columnFamily, final String columnName,
      final String startWith, final short size); static long recordFrequency(IndexReader reader, String columnFamily, String columnName, String value); static List<String> terms(IndexReader reader, FieldTypeDefinition typeDef, String columnFamily,
      String columnName, String startWith, short size); void mutate(final RowMutation mutation); void mutate(final List<RowMutation> mutations); void enqueue(List<RowMutation> mutations); static boolean resetExitableReader(IndexReader indexReader, AtomicBoolean running); void optimize(String table, int numberOfSegmentsPerShard); void enqueue(RowMutation mutation); void bulkMutateAdd(String table, String bulkId, RowMutation mutation); void bulkMutateFinish(Set<String> potentialTables, String bulkId, boolean apply, boolean blockUntilComplete); void bulkMutateAddMultiple(String table, String bulkId, List<RowMutation> rowMutations); static final String NOT_FOUND; static AtomicBoolean DEBUG_RUN_SLOW; }