Package org.apache.blur.thrift

Examples of org.apache.blur.thrift.BException


    for (Future<Void> future : futures) {
      try {
        future.get();
      } catch (InterruptedException e) {
        throw new BException("Unknown error during mutation", e);
      } catch (ExecutionException e) {
        throw new BException("Unknown error during mutation", e.getCause());
      }
    }
  }
View Full Code Here


      if (mutation.waitToBeVisible) {
        waitToBeVisible = true;
      }
      BlurIndex blurIndex = indexes.get(shard);
      if (blurIndex == null) {
        throw new BException("Shard [" + shard + "] in table [" + table + "] is not being served by this server.");
      }

      boolean waitVisiblity = false;
      if (i + 1 == mutations.size()) {
        waitVisiblity = waitToBeVisible;
View Full Code Here

    Map<String, BlurIndex> indexes = _indexServer.getIndexes(table);
    MutationHelper.validateMutation(mutation);
    String shard = MutationHelper.getShardName(table, mutation.rowId, getNumberOfShards(table), _blurPartitioner);
    BlurIndex blurIndex = indexes.get(shard);
    if (blurIndex == null) {
      throw new BException("Shard [" + shard + "] in table [" + table + "] is not being served by this server.");
    }

    RowMutationType type = mutation.rowMutationType;
    switch (type) {
    case REPLACE_ROW:
View Full Code Here

      switch (type) {
      case DELETE_ENTIRE_RECORD:
        // do nothing as missing record is already in desired state
        break;
      case APPEND_COLUMN_VALUES:
        throw new BException("Mutation cannot append column values to non-existent record", recordMutation);
      case REPLACE_ENTIRE_RECORD:
        newRow.addToRecords(recordMutation.record);
        break;
      case REPLACE_COLUMNS:
        throw new BException("Mutation cannot replace columns in non-existent record", recordMutation);
      default:
        throw new RuntimeException("Unsupported record mutation type [" + type + "]");
      }
    }
View Full Code Here

    Map<String, BlurIndex> blurIndexes;
    try {
      blurIndexes = _indexServer.getIndexes(table);
    } catch (IOException e) {
      LOG.error("Unknown error while trying to fetch index readers.", e);
      throw new BException(e.getMessage(), e);
    }

    Collection<BlurIndex> values = blurIndexes.values();
    for (BlurIndex index : values) {
      try {
        index.optimize(numberOfSegmentsPerShard);
      } catch (IOException e) {
        LOG.error("Unknown error while trying to optimize indexes.", e);
        throw new BException(e.getMessage(), e);
      }
    }
  }
View Full Code Here

  public Future<T> poll(long timeout, TimeUnit unit, boolean throwExceptionIfTimeout, Object... parameters) throws BlurException {
    try {
      Future<T> future = poll(timeout, unit);
      if (future == null) {
        throw new BException("Call timeout [{0}]", Arrays.asList(parameters));
      }
      return future;
    } catch (InterruptedException e) {
      throw new BException("Call interrupted [{0}]", e, Arrays.asList(parameters));
    }
  }
View Full Code Here

  public T getResultThrowException(Future<T> future, Object... parameters) throws BlurException {
    try {
      return future.get();
    } catch (InterruptedException e) {
      throw new BException("Call interrupted [{0}]", e, Arrays.asList(parameters));
    } catch (ExecutionException e) {
      Throwable cause = e.getCause();
      if (cause instanceof BlurException) {
        throw (BlurException) cause;
      }
      throw new BException("Call execution exception [{0}]", cause, Arrays.asList(parameters));
    }
  }
View Full Code Here

          if (targetException instanceof BlurException) {
            throw targetException;
          } else if (targetException instanceof TException) {
            throw targetException;
          } else {
            throw new BException(
                "Unknown error during call on method [{0}], this means that the method is handling exceptions correctly.",
                targetException, method.getName());
          }
        }
      }
View Full Code Here

    _running = running;
    _sort = sort;
    try {
      _query = searcher.rewrite(query);
    } catch (IOException e) {
      throw new BException("Unknown error during rewrite", e);
    }
    _searcher = searcher;
    _numHitsToCollect = numHitsToCollect;
    _totalHitsRef = totalHitsRef == null ? new TotalHitsRef() : totalHitsRef;
    _progressRef = progressRef == null ? new ProgressRef() : progressRef;
View Full Code Here

      } catch (StopExecutionCollectorException e) {
        throw new BlurException(STOP_EXECUTION_COLLECTOR_EXCEPTION, null, ErrorType.UNKNOWN);
      } catch (ExitingReaderException e) {
        throw new BlurException(STOP_EXECUTION_COLLECTOR_EXCEPTION, null, ErrorType.UNKNOWN);
      } catch (IOException e) {
        throw new BException("Unknown error during search call", e);
      }
      if (scoreDocs.length > 0) {
        after = scoreDocs[scoreDocs.length - 1];
        addLastScoreDoc();
      } else {
View Full Code Here

TOP

Related Classes of org.apache.blur.thrift.BException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.