Search in sources :

Example 41 with DataChangeVersion

use of org.apache.drill.exec.store.sys.store.DataChangeVersion in project drill by apache.

the class TestZookeeperClient method testGetWithVersion.

@Test
public void testGetWithVersion() {
    client.put(path, data);
    DataChangeVersion version0 = new DataChangeVersion();
    client.get(path, version0);
    assertEquals("Versions should match", 0, version0.getVersion());
    client.put(path, data);
    DataChangeVersion version1 = new DataChangeVersion();
    client.get(path, version1);
    assertEquals("Versions should match", 1, version1.getVersion());
}
Also used : DataChangeVersion(org.apache.drill.exec.store.sys.store.DataChangeVersion) BaseTest(org.apache.drill.test.BaseTest) Test(org.junit.Test)

Example 42 with DataChangeVersion

use of org.apache.drill.exec.store.sys.store.DataChangeVersion in project drill by apache.

the class TestZookeeperClient method testHasPathTrueWithVersion.

@Test
public void testHasPathTrueWithVersion() {
    client.put(path, data);
    DataChangeVersion version0 = new DataChangeVersion();
    assertTrue(client.hasPath(path, true, version0));
    assertEquals("Versions should match", 0, version0.getVersion());
    client.put(path, data);
    DataChangeVersion version1 = new DataChangeVersion();
    assertTrue(client.hasPath(path, true, version1));
    assertEquals("Versions should match", 1, version1.getVersion());
}
Also used : DataChangeVersion(org.apache.drill.exec.store.sys.store.DataChangeVersion) BaseTest(org.apache.drill.test.BaseTest) Test(org.junit.Test)

Example 43 with DataChangeVersion

use of org.apache.drill.exec.store.sys.store.DataChangeVersion in project drill by apache.

the class TestZookeeperClient method testPutWithMatchingVersion.

@Test
public void testPutWithMatchingVersion() {
    client.put(path, data);
    DataChangeVersion version = new DataChangeVersion();
    client.get(path, version);
    client.put(path, data, version);
}
Also used : DataChangeVersion(org.apache.drill.exec.store.sys.store.DataChangeVersion) BaseTest(org.apache.drill.test.BaseTest) Test(org.junit.Test)

Aggregations

DataChangeVersion (org.apache.drill.exec.store.sys.store.DataChangeVersion)43 Test (org.junit.Test)34 RemoteFunctionRegistry (org.apache.drill.exec.expr.fn.registry.RemoteFunctionRegistry)28 Registry (org.apache.drill.exec.proto.UserBitShared.Registry)25 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)24 FunctionImplementationRegistry (org.apache.drill.exec.expr.fn.FunctionImplementationRegistry)23 LocalFunctionRegistry (org.apache.drill.exec.expr.fn.registry.LocalFunctionRegistry)21 VersionMismatchException (org.apache.drill.exec.exception.VersionMismatchException)19 SlowTest (org.apache.drill.categories.SlowTest)16 SqlFunctionTest (org.apache.drill.categories.SqlFunctionTest)16 Matchers.anyString (org.mockito.Matchers.anyString)16 Path (java.nio.file.Path)11 HadoopUtils.hadoopToJavaPath (org.apache.drill.test.HadoopUtils.hadoopToJavaPath)11 FileSystem (org.apache.hadoop.fs.FileSystem)11 Jar (org.apache.drill.exec.proto.UserBitShared.Jar)10 DrillRuntimeException (org.apache.drill.common.exceptions.DrillRuntimeException)9 IOException (java.io.IOException)8 Path (org.apache.hadoop.fs.Path)8 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)8 CountDownLatch (java.util.concurrent.CountDownLatch)6