Package org.commoncrawl.query

Examples of org.commoncrawl.query.QueryStatus


    synchronized (theQueryObject) {
      queryId = theQueryObject.getQueryId();
      shardId = theQueryObject.getRemoteQueryInfo().getShardId();
    }
   
    QueryStatus targetStatus = null;
   
    synchronized (_slaveStatus) {
      for (QueryStatus status : _slaveStatus.getQueryStatus()) {
        // if query ids and shard ids match
        if (status.getQueryId() == queryId
              && status.getShardId() == shardId) {
          targetStatus = status;
          break;
        }
      }
    }
   
    boolean addNewStatus = (targetStatus == null);
    if (targetStatus == null) {
      targetStatus = new QueryStatus();
    }
    synchronized (theQueryObject) {
      // clear fields that are only relavent at the master
      theQueryObject.getQueryStatus().setFieldClean(QueryStatus.Field_ATTEMPTS);
      theQueryObject.getQueryStatus().setFieldClean(QueryStatus.Field_LASTATTEMPTTIME);
     
      try {
        targetStatus.merge(theQueryObject.getQueryStatus());
      } catch (CloneNotSupportedException e) {
      }
    }
   
    if (addNewStatus) {
View Full Code Here


 
  public QueryRequest(Query<DataType,KeyType,ValueType> query,ClientQueryInfo ClientQueryInfo,QueryCompletionCallback<DataType,KeyType,ValueType> callback) {
    _querySource = query;
    _clientQueryObj = ClientQueryInfo;
    _completionCallback = callback;
    _queryStatus = new QueryStatus();
    _queryStatus.setQueryId(ClientQueryInfo.getClientQueryId());
    _queryStatus.setStatus(QueryStatus.Status.PENDING);
  }
View Full Code Here

TOP

Related Classes of org.commoncrawl.query.QueryStatus

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.