Package org.elasticsearch

Examples of org.elasticsearch.ElasticsearchException$WithRestHeaders


            default:


               if ((curOffsetWithInStorage + curOrdinalNoForDoc) > MAX_STORAGE_SIZE) {
                  if (curOrdinalNoForDoc > MAX_STORAGE_SIZE - 1) {
                     throw new ElasticSearchException(
                             String.format("Number of values for doc %s has a exceeded the maximum allowed " +
                                     "(got %s values, max %s)",
                                     curDoc, curOrdinalNoForDoc, MAX_STORAGE_SIZE - 1));
                  }
View Full Code Here


         else if (indexForDoc > 0) {  // multi ordinal doc skip to right place in storage.
            int storageArrayIndex = indexForDoc >> MAX_STORAGE_SIZE_SHIFT;
            int[] storageArray = targetArray.storageArrays[storageArrayIndex];
            indexForDoc -= storageArrayIndex << MAX_STORAGE_SIZE_SHIFT;
            if (indexForDoc >= storageArray.length)
               throw new ElasticSearchException(
                       String.format("Ordinal overflow for docId %s. storageArrayIndex: %s, storageArray.length: %s," +
                               " indexForDoc:%s, currentIndexForDocs[docId]: %s, firstDoc: %s",
                               docId, storageArrayIndex, storageArray.length, indexForDoc, currentIndexForDocs[docId],
                               firstDoc));
            if (storageArray[indexForDoc] !=0 )
               throw new ElasticSearchException(
                       String.format("Ordinal overflow for docId %s.", docId));

            if (!firstDoc) storageArray[indexForDoc-1] *= -1; // remove end marker from prv. ordinal.
            storageArray[indexForDoc] = -ordinal; // mark as end
            currentIndexForDocs[docId]++;
         }
         else {
            throw new ElasticSearchException(
                    String.format("We expected one ordinal for docId %s but got more.", docId));
         }
      }
View Full Code Here

            }
            ret = null;
         }
         stream.end();
      } catch (IOException e) {
         throw new ElasticSearchException("failed to analyze", e);
      } finally {
         if (stream != null) {
            try {
               stream.close();
            } catch (IOException e) {
View Full Code Here

    DistinctCountPayload mergeInto(final TLongObjectMap<DistinctCountPayload> map, final long key) {
        if(map.containsKey(key))
            try {
                map.put(key, this.merge(map.get(key)));
            } catch(final CardinalityMergeException e) {
                throw new ElasticSearchException("Unable to merge two facet cardinality objects", e);
            }
        else
            map.put(key, this);
        return this;
    }
View Full Code Here

    <K> DistinctCountPayload mergeInto(final ExtTHashMap<K, DistinctCountPayload> map, final K key) {
        if(map.containsKey(key))
            try {
                map.put(key, this.merge(map.get(key)));
            } catch(final CardinalityMergeException e) {
                throw new ElasticSearchException("Unable to merge two facet cardinality objects", e);
            }
        else
            map.put(key, this);
        return this;
    }
View Full Code Here

  @Override
  public void executeESBulkRequest(BulkRequestBuilder esBulk) throws Exception {
    BulkResponse response = esBulk.execute().actionGet();
    if (response.hasFailures()) {
      throw new ElasticSearchException("Failed to execute ES index bulk update: " + response.buildFailureMessage());
    }
  }
View Full Code Here

  @Override
  public void executeESBulkRequest(BulkRequestBuilder esBulk) throws Exception {
    BulkResponse response = esBulk.execute().actionGet();
    if (response.hasFailures()) {
      throw new ElasticSearchException("Failed to execute ES index bulk update: " + response.buildFailureMessage());
    }
  }
View Full Code Here

    } else {
      logger.debug("JIRA River {} found on this node, go to call mgm operation on it {}", req.getRiverName(), req);
      try {
        return performOperationOnJiraRiver(river, req, clusterService.localNode());
      } catch (Exception e) {
        throw new ElasticSearchException(e.getMessage(), e);
      }
    }
  }
View Full Code Here

    try {
      constructor = cls.getConstructor(Settings.class);
      try {
        return constructor.newInstance(settings);
      } catch (Exception e) {
        throw new ElasticSearchException("Failed to create instance [" + cls + "]", e);
      }
    } catch (NoSuchMethodException e) {
      try {
        constructor = cls.getConstructor();
        try {
          return constructor.newInstance();
        } catch (Exception e1) {
          throw new ElasticSearchException("Failed to create instance [" + cls + "]", e);
        }
      } catch (NoSuchMethodException e1) {
        throw new ElasticSearchException("No constructor for [" + cls + "]");
      }
    }
  }
View Full Code Here

    try {
      constructor = cls.getConstructor(arg.getClass(), Settings.class);
      try {
        return constructor.newInstance(arg, settings);
      } catch (Exception e) {
        throw new ElasticSearchException("Failed to create instance [" + cls + "]", e);
      }
    } catch (NoSuchMethodException e) {
      try {
        constructor = cls.getConstructor(arg.getClass());
        try {
          return constructor.newInstance(arg);
        } catch (Exception e1) {
          throw new ElasticSearchException("Failed to create instance [" + cls + "]", e);
        }
      } catch (NoSuchMethodException e1) {
        throw new ElasticSearchException("No constructor for [" + cls + "] and argument " + arg.getClass());
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.elasticsearch.ElasticsearchException$WithRestHeaders

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.