Refine search
private void throwFreezeExceptionWithoutMessage(FreezeParameters freezeParameters) { try { throw freezeParameters.exceptionClass.newInstance(); } catch (InstantiationException | IllegalAccessException ie) { OLogManager.instance().error(this, "Can not create instance of exception " + freezeParameters.exceptionClass + " will park thread instead of throwing of exception", ie); } }
public static byte[] copyOfRange(final byte[] iSource, final int iBegin, final int iEnd) { final int newLength = iEnd - iBegin; if (newLength < 0) throw new IllegalArgumentException(iBegin + " > " + iEnd); try { final byte[] copy = new byte[newLength]; System.arraycopy(iSource, iBegin, copy, 0, Math.min(iSource.length - iBegin, newLength)); return copy; } catch (OutOfMemoryError e) { OLogManager.instance().error(null, "Error on copying buffer of size %d bytes", e, newLength); throw e; } }
@Override public long deletedDocs(Query query) { try { IndexSearcher indexSearcher = new IndexSearcher(DirectoryReader.open(deletedIdx, true, true)); TopDocs search = indexSearcher.search(query, Integer.MAX_VALUE); return search.totalHits; } catch (IOException e) { OLogManager.instance().error(this, "Error during searcher index instantiation on deleted documents ", e); } finally { } return 0; } }
public OETLComponentFactory registerExtractor(final Class<? extends OExtractor> iComponent) { try { extractors.put(iComponent.newInstance().getName(), iComponent); } catch (Exception e) { OLogManager.instance().error(this, "Error on registering extractor: %s", iComponent.getName()); } return this; }
private OFreezableStorageComponent getFreezableStorage() { OStorage s = getStorage(); if (s instanceof OFreezableStorageComponent) return (OFreezableStorageComponent) s; else { OLogManager.instance().error(this, "Storage of type " + s.getType() + " does not support freeze operation", null); return null; } }