private synchronized void notifyAboutChanges(Map<String, Settings> typeToConfig) { for (Map.Entry<String, ConfigurationChangeListener> entry : configTypeToChancheListener.entries()) { String type = entry.getKey(); ConfigurationChangeListener listener = entry.getValue(); Settings settings = typeToConfig.get(type); if (settings == null) { continue; } try { LOGGER.debug("Notify {} listener about change configuration with type {}", listener, type); listener.onChange(settings); } catch (Exception e) { LOGGER.error("{} listener errored: "+e, listener, e); throw ExceptionsHelper.convertToElastic(e); } } }
throw ExceptionsHelper.convertToElastic(e); } finally { if(parser != null) {
throw ExceptionsHelper.convertToElastic(e); } finally { if(parser != null) {
@Override public BitSet getBitSet(LeafReaderContext context) throws IOException { try { return getAndLoadIfNotPresent(query, context); } catch (ExecutionException e) { throw ExceptionsHelper.convertToElastic(e); } }
public static ElasticsearchException newConfigurationException(String processorType, String processorTag, String propertyName, Exception cause) { ElasticsearchException exception = ExceptionsHelper.convertToElastic(cause); addHeadersToException(exception, processorType, processorTag, propertyName); return exception; }
@Override public ScriptDocValues<?> get(Object key) { // assume its a string... String fieldName = key.toString(); ScriptDocValues<?> scriptValues = localCacheFieldData.get(fieldName); if (scriptValues == null) { final MappedFieldType fieldType = mapperService.fullName(fieldName); if (fieldType == null) { throw new IllegalArgumentException("No field found for [" + fieldName + "] in mapping with types " + Arrays.toString(types)); } // load fielddata on behalf of the script: otherwise it would need additional permissions // to deal with pagedbytes/ramusagestimator/etc scriptValues = AccessController.doPrivileged(new PrivilegedAction<ScriptDocValues<?>>() { @Override public ScriptDocValues<?> run() { return fieldDataLookup.apply(fieldType).load(reader).getScriptValues(); } }); localCacheFieldData.put(fieldName, scriptValues); } try { scriptValues.setNextDocId(docId); } catch (IOException e) { throw ExceptionsHelper.convertToElastic(e); } return scriptValues; }
public static String getParentId(ParentFieldMapper fieldMapper, LeafReader reader, int docId) { try { SortedDocValues docValues = reader.getSortedDocValues(fieldMapper.name()); if (docValues == null || docValues.advanceExact(docId) == false) { // hit has no _parent field. return null; } BytesRef parentId = docValues.binaryValue(); return parentId.length > 0 ? parentId.utf8ToString() : null; } catch (IOException e) { throw ExceptionsHelper.convertToElastic(e); } } }
throw ExceptionsHelper.convertToElastic(e); } finally { context.clearReleasables(Lifetime.COLLECTION);
@Override public BitSet getBitSet(LeafReaderContext context) throws IOException { try { return getAndLoadIfNotPresent(query, context); } catch (ExecutionException e) { throw ExceptionsHelper.convertToElastic(e); } }
@Override public BitSet getBitSet(LeafReaderContext context) throws IOException { try { return getAndLoadIfNotPresent(query, context); } catch (ExecutionException e) { throw ExceptionsHelper.convertToElastic(e); } }
@Override public BitSet getBitSet(LeafReaderContext context) throws IOException { try { return getAndLoadIfNotPresent(query, context); } catch (ExecutionException e) { throw ExceptionsHelper.convertToElastic(e); } }
@Override public BitSet getBitSet(LeafReaderContext context) throws IOException { try { return getAndLoadIfNotPresent(query, context); } catch (ExecutionException e) { throw ExceptionsHelper.convertToElastic(e); } }
throw ExceptionsHelper.convertToElastic(ex);
public static ElasticsearchException newConfigurationException(String processorType, String processorTag, String propertyName, Exception cause) { ElasticsearchException exception = ExceptionsHelper.convertToElastic(cause); addHeadersToException(exception, processorType, processorTag, propertyName); return exception; }
public static ElasticsearchException newConfigurationException(String processorType, String processorTag, String propertyName, Exception cause) { ElasticsearchException exception = ExceptionsHelper.convertToElastic(cause); addHeadersToException(exception, processorType, processorTag, propertyName); return exception; }
throw ExceptionsHelper.convertToElastic(e);
public static ElasticsearchException newConfigurationException(String processorType, String processorTag, String propertyName, Exception cause) { ElasticsearchException exception = ExceptionsHelper.convertToElastic(cause); addHeadersToException(exception, processorType, processorTag, propertyName); return exception; }
public static String getParentId(ParentFieldMapper fieldMapper, LeafReader reader, int docId) { try { SortedDocValues docValues = reader.getSortedDocValues(fieldMapper.name()); if (docValues == null) { // hit has no _parent field. return null; } BytesRef parentId = docValues.get(docId); return parentId.length > 0 ? parentId.utf8ToString() : null; } catch (IOException e) { throw ExceptionsHelper.convertToElastic(e); } }
public static String getParentId(ParentFieldMapper fieldMapper, LeafReader reader, int docId) { try { SortedDocValues docValues = reader.getSortedDocValues(fieldMapper.name()); if (docValues == null || docValues.advanceExact(docId) == false) { // hit has no _parent field. return null; } BytesRef parentId = docValues.binaryValue(); return parentId.length > 0 ? parentId.utf8ToString() : null; } catch (IOException e) { throw ExceptionsHelper.convertToElastic(e); } } }
public static String getParentId(ParentFieldMapper fieldMapper, LeafReader reader, int docId) { try { SortedDocValues docValues = reader.getSortedDocValues(fieldMapper.name()); if (docValues == null || docValues.advanceExact(docId) == false) { // hit has no _parent field. return null; } BytesRef parentId = docValues.binaryValue(); return parentId.length > 0 ? parentId.utf8ToString() : null; } catch (IOException e) { throw ExceptionsHelper.convertToElastic(e); } } }