use of org.smartdata.client.SmartClient in project SSM by Intel-bigdata.
the class TestSmartClient method testDataIgnoreAndCover.
@Test
public void testDataIgnoreAndCover() throws Exception {
waitTillSSMExitSafeMode();
// Configuration can also be used for initializing SmartClient.
Configuration conf = new Configuration();
conf.set(SmartConfKeys.SMART_IGNORE_DIRS_KEY, "/test1");
conf.set(SmartConfKeys.SMART_COVER_DIRS_KEY, "/test2");
SmartClient client = new SmartClient(conf);
Assert.assertTrue("This test file should be ignored", client.shouldIgnore("/test1/a.txt"));
Assert.assertFalse("This test file should not be ignored", client.shouldIgnore("/test2/b.txt"));
}
use of org.smartdata.client.SmartClient in project SSM by Intel-bigdata.
the class TestSmartClient method testGetFileState.
@Test
public void testGetFileState() throws Exception {
waitTillSSMExitSafeMode();
MetaStore metaStore = ssm.getMetaStore();
String path = "/file1";
FileState fileState = new NormalFileState(path);
SmartClient client = new SmartClient(smartContext.getConf());
FileState fileState1;
// No entry in file_state table (Normal type as default)
fileState1 = client.getFileState(path);
Assert.assertEquals(fileState, fileState1);
metaStore.insertUpdateFileState(fileState);
fileState1 = client.getFileState(path);
Assert.assertEquals(fileState, fileState1);
}
Aggregations