Search in sources :

Example 1 with DefaultDeviceResolver

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());
}
Also used : IODeviceHandle(org.apache.hyracks.api.io.IODeviceHandle) DefaultDeviceResolver(org.apache.hyracks.control.nc.io.DefaultDeviceResolver) IOManager(org.apache.hyracks.control.nc.io.IOManager) FileReference(org.apache.hyracks.api.io.FileReference) File(java.io.File) Test(org.junit.Test)

Example 2 with DefaultDeviceResolver

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;
}
Also used : IODeviceHandle(org.apache.hyracks.api.io.IODeviceHandle) DefaultDeviceResolver(org.apache.hyracks.control.nc.io.DefaultDeviceResolver) IOManager(org.apache.hyracks.control.nc.io.IOManager) ArrayList(java.util.ArrayList) File(java.io.File)

Example 3 with DefaultDeviceResolver

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());
}
Also used : IODeviceHandle(org.apache.hyracks.api.io.IODeviceHandle) DefaultDeviceResolver(org.apache.hyracks.control.nc.io.DefaultDeviceResolver) IOManager(org.apache.hyracks.control.nc.io.IOManager) ArrayList(java.util.ArrayList) File(java.io.File)

Example 4 with 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());
}
Also used : IODeviceHandle(org.apache.hyracks.api.io.IODeviceHandle) DefaultDeviceResolver(org.apache.hyracks.control.nc.io.DefaultDeviceResolver) IOManager(org.apache.hyracks.control.nc.io.IOManager) File(java.io.File) Test(org.junit.Test)

Example 5 with 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());
}
Also used : IODeviceHandle(org.apache.hyracks.api.io.IODeviceHandle) DefaultDeviceResolver(org.apache.hyracks.control.nc.io.DefaultDeviceResolver) IOManager(org.apache.hyracks.control.nc.io.IOManager) ArrayList(java.util.ArrayList) File(java.io.File)

Aggregations

File (java.io.File)5 IODeviceHandle (org.apache.hyracks.api.io.IODeviceHandle)5 DefaultDeviceResolver (org.apache.hyracks.control.nc.io.DefaultDeviceResolver)5 IOManager (org.apache.hyracks.control.nc.io.IOManager)5 ArrayList (java.util.ArrayList)3 Test (org.junit.Test)2 FileReference (org.apache.hyracks.api.io.FileReference)1