Package org.elasticsearch

Examples of org.elasticsearch.ElasticsearchException


                        loadMappings(file, createdMappings, index, type);
                    }
                }
            }
            } catch (Exception e) {
                throw new ElasticSearchException("::" ,e);
            }
            // import data according to the given data file pattern
            for (File file : files) {
                String fileName = file.getName();
                if (!fileName.endsWith(".mapping") && !fileName.endsWith(".settings")) {
View Full Code Here


                String[] parts = part.split("\\.", 2);
                Object o = root.get(parts[0]);
                if (o == null) {
                    o = new HashMap<String, Object>();
                } else if (!(o instanceof Map)) {
                    throw new ElasticSearchException("Error on rewriting objects: Mixed objects and values");
                }
                Map<String, Object> sub = (Map<String, Object>) o;
                writeMap(sub, value, parts[1]);
                root.put(parts[0], sub);
            } else {
                if (((Map<String, Object>) root).get(part) instanceof Map) {
                    throw new ElasticSearchException("Error on rewriting objects: Mixed objects and values");
                }
                root.put(part, value);
            }
        }
View Full Code Here

            byte[] buffer = new byte[1024];
            for (long cur = 0; cur < partToRead; cur += buffer.length) {
                try {
                    input.read(buffer, 0, (int) (partToRead - cur > buffer.length ? buffer.length : partToRead - cur));
                } catch (IOException ex) {
                    throw new ElasticsearchException("cannot read input stream", ex);
                }
            }
            AmazonS3Exception ex = new AmazonS3Exception("Random S3 exception");
            ex.setStatusCode(400);
            ex.setErrorCode("RequestTimeout");
View Full Code Here

            byte[] bytes = digest.digest(path.getBytes("UTF-8"));
            int i = 0;
            return ((bytes[i++] & 0xFF) << 24) | ((bytes[i++] & 0xFF) << 16)
                    | ((bytes[i++] & 0xFF) << 8) | (bytes[i++] & 0xFF);
        } catch (UnsupportedEncodingException ex) {
            throw new ElasticsearchException("cannot calculate hashcode", ex);
        } catch (NoSuchAlgorithmException ex) {
            throw new ElasticsearchException("cannot calculate hashcode", ex);
        }
    }
View Full Code Here

        }
      }
      if (containsSuccess) {
        throw new BulkUpdatePartialFailureException(response.buildFailureMessage(), numOfFailures);
      } else {
        throw new ElasticsearchException("Failed to completely execute ES index bulk update for " + numOfFailures
            + " commands: " + response.buildFailureMessage());
      }
    }
  }
View Full Code Here

    } else {
      logger.debug("River {} found on this node, go to call mgm operation on it {}", req.getRiverName(), req);
      try {
        return performOperationOnRiver(river, req, clusterService.localNode());
      } catch (Exception e) {
        throw new ElasticsearchException(e.getMessage(), e);
      }
    }
  }
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

  @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

      logger.debug("Sysinfo River {} found on this node, go to call mgm operation on it {}", req.getRiverName(), req);
      try {
        return performOperationOnRiver(river, req, clusterService.localNode());
      } catch (Exception e) {
        logger.error("Exception from river management operation: {}", e, e.getMessage());
        throw new ElasticsearchException(e.getMessage(), e);
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.elasticsearch.ElasticsearchException

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.