use of org.apache.hyracks.control.nc.io.DefaultDeviceResolver in project asterixdb by apache.
the class IOManagerPathTest method testPrefixNames.
@Test
public void testPrefixNames() throws HyracksDataException {
IODeviceHandle shorter = new IODeviceHandle(new File("/tmp/tst/1"), "storage");
IODeviceHandle longer = new IODeviceHandle(new File("/tmp/tst/11"), "storage");
IOManager ioManager = new IOManager(Arrays.asList(new IODeviceHandle[] { shorter, longer }), new DefaultDeviceResolver());
FileReference f = ioManager.resolveAbsolutePath("/tmp/tst/11/storage/Foo_idx_foo/my_btree");
Assert.assertEquals("/tmp/tst/11/storage/Foo_idx_foo/my_btree", f.getAbsolutePath());
}
use of org.apache.hyracks.control.nc.io.DefaultDeviceResolver in project asterixdb by apache.
the class TestStorageManagerComponentHolder method getIOManager.
public static synchronized IOManager getIOManager() throws HyracksDataException {
if (ioManager == null) {
List<IODeviceHandle> devices = new ArrayList<>();
devices.add(new IODeviceHandle(new File(System.getProperty("user.dir") + File.separator + "target"), "iodev_test_wa"));
ioManager = new IOManager(devices, Executors.newCachedThreadPool(), new DefaultDeviceResolver());
}
return ioManager;
}
use of org.apache.hyracks.control.nc.io.DefaultDeviceResolver in project asterixdb by apache.
the class TestUtils method createIoManager.
private static IOManager createIoManager() throws HyracksException {
List<IODeviceHandle> devices = new ArrayList<>();
devices.add(new IODeviceHandle(new File(System.getProperty("java.io.tmpdir")), "."));
return new IOManager(devices, Executors.newCachedThreadPool(), new DefaultDeviceResolver());
}
use of org.apache.hyracks.control.nc.io.DefaultDeviceResolver in project asterixdb by apache.
the class IOManagerPathTest method testDuplicates.
@Test(expected = HyracksDataException.class)
public void testDuplicates() throws HyracksDataException {
IODeviceHandle first = new IODeviceHandle(new File("/tmp/tst/1"), "storage");
IODeviceHandle second = new IODeviceHandle(new File("/tmp/tst/1"), "storage");
IOManager ioManager = new IOManager(Arrays.asList(new IODeviceHandle[] { first, second }), new DefaultDeviceResolver());
}
use of org.apache.hyracks.control.nc.io.DefaultDeviceResolver in project asterixdb by apache.
the class LSMIndexFileManagerTest method createIOManager.
private IOManager createIOManager(int numDevices) throws HyracksDataException {
List<IODeviceHandle> devices = new ArrayList<>();
for (int i = 0; i < numDevices; i++) {
String iodevPath = System.getProperty("java.io.tmpdir") + sep + "test_iodev" + i;
devices.add(new IODeviceHandle(new File(iodevPath), "wa"));
}
return new IOManager(devices, Executors.newCachedThreadPool(), new DefaultDeviceResolver());
}
Aggregations