use of java.io.UncheckedIOException in project neo4j by neo4j.
the class NativeLabelScanReader method nodesWithLabel.
@Override
public PrimitiveLongIterator nodesWithLabel(int labelId) {
RawCursor<Hit<LabelScanKey, LabelScanValue>, IOException> cursor;
try {
ensureOpenCursorsClosed();
cursor = seekerForLabel(labelId);
openCursors.offer(cursor);
} catch (IOException e) {
throw new UncheckedIOException(e);
}
return new LabelScanValueIterator(cursor);
}
use of java.io.UncheckedIOException in project neo4j by neo4j.
the class NativeLabelScanReader method iteratorsForLabels.
private List<PrimitiveLongIterator> iteratorsForLabels(int[] labelIds) {
List<PrimitiveLongIterator> iterators = new ArrayList<>();
try {
ensureOpenCursorsClosed();
for (int labelId : labelIds) {
RawCursor<Hit<LabelScanKey, LabelScanValue>, IOException> cursor = seekerForLabel(labelId);
openCursors.offer(cursor);
iterators.add(new LabelScanValueIterator(cursor));
}
} catch (IOException e) {
throw new UncheckedIOException(e);
}
return iterators;
}
use of java.io.UncheckedIOException in project neo4j by neo4j.
the class RestartableFileSystemWatcher method stopWatching.
@Override
public void stopWatching() {
try {
IOUtils.closeAll(watchedResources);
watchedResources.clear();
} catch (IOException e) {
throw new UncheckedIOException(e);
} finally {
delegate.stopWatching();
}
}
use of java.io.UncheckedIOException in project neo4j by neo4j.
the class GraphStoreFixture method startLabelScanStore.
private LabelScanStore startLabelScanStore(Config config, Dependencies dependencies, KernelContext kernelContext) {
// Load correct LSS from kernel extensions
LifeSupport life = new LifeSupport();
KernelExtensions extensions = life.add(new KernelExtensions(kernelContext, (Iterable) load(KernelExtensionFactory.class), dependencies, ignore()));
life.start();
LabelScanStore labelScanStore = extensions.resolveDependency(LabelScanStoreProvider.class, new NamedLabelScanStoreSelectionStrategy(config)).getLabelScanStore();
life.shutdown();
// Start the selected LSS
try {
labelScanStore.init();
labelScanStore.start();
} catch (IOException e) {
throw new UncheckedIOException(e);
}
return labelScanStore;
}
use of java.io.UncheckedIOException in project es6draft by anba.
the class ChakraTest method readSettings.
private static Map<String, TestSetting> readSettings(Path dir) {
Path settingsFile = dir.resolve("rlexe.xml");
if (Files.isRegularFile(settingsFile)) {
try (Reader reader = bomReader(Files.newInputStream(settingsFile))) {
Document doc = Resources.xml(reader);
NodeList elements = doc.getElementsByTagName("default");
HashMap<String, TestSetting> settingMap = new HashMap<>();
for (int i = 0, length = elements.getLength(); i < length; ++i) {
Element element = (Element) elements.item(i);
String files = element.getElementsByTagName("files").item(0).getTextContent();
TestSetting setting = new TestSetting();
NodeList baseline = element.getElementsByTagName("baseline");
if (baseline.getLength() > 0) {
setting.baseline = baseline.item(0).getTextContent();
}
NodeList compileFlags = element.getElementsByTagName("compile-flags");
if (compileFlags.getLength() > 0) {
String flags = compileFlags.item(0).getTextContent();
setting.disabled = flags.contains("-verbose") || flags.contains("-dump:") || flags.contains("-trace:") || flags.contains("-testtrace:") || flags.contains("-testTrace:");
}
settingMap.putIfAbsent(files, setting);
}
return settingMap;
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
return Collections.emptyMap();
}
Aggregations