use of org.smartdata.model.SystemInfo in project SSM by Intel-bigdata.
the class AlluxioEntryFetchAndApplyTask method run.
@Override
public void run() {
LOG.trace("AlluxioEntryFetchAndApplyTask run at " + new Date());
try {
JournalEntry journalEntry = journalReader.read();
while (journalEntry != null) {
entryApplier.apply(journalEntry);
lastSn.getAndSet(journalEntry.getSequenceNumber());
metaStore.updateAndInsertIfNotExist(new SystemInfo(SmartConstants.SMART_ALLUXIO_LAST_ENTRY_SN, String.valueOf(lastSn.get())));
journalEntry = journalReader.read();
}
} catch (Throwable t) {
LOG.error("Alluxio Entry Apply Events error", t);
}
}
use of org.smartdata.model.SystemInfo in project SSM by Intel-bigdata.
the class TestMetaStore method testInsertSystemInfo.
@Test
public void testInsertSystemInfo() throws MetaStoreException {
SystemInfo systemInfo = new SystemInfo("test", "test");
metaStore.insertSystemInfo(systemInfo);
Assert.assertTrue(metaStore.getSystemInfoByProperty("test").equals(systemInfo));
}
use of org.smartdata.model.SystemInfo in project SSM by Intel-bigdata.
the class TestMetaStore method testDeleteSystemInfo.
@Test
public void testDeleteSystemInfo() throws MetaStoreException {
SystemInfo systemInfo = new SystemInfo("test", "test");
metaStore.insertSystemInfo(systemInfo);
metaStore.deleteSystemInfo("test");
Assert.assertTrue(metaStore.listAllSystemInfo().size() == 0);
}
use of org.smartdata.model.SystemInfo in project SSM by Intel-bigdata.
the class InotifyFetchAndApplyTask method run.
@Override
public void run() {
LOG.trace("InotifyFetchAndApplyTask run at " + new Date());
try {
EventBatch eventBatch = inotifyEventInputStream.poll();
while (eventBatch != null) {
applier.apply(eventBatch.getEvents());
lastId.getAndSet(eventBatch.getTxid());
metaStore.updateAndInsertIfNotExist(new SystemInfo(SmartConstants.SMART_HDFS_LAST_INOTIFY_TXID, String.valueOf(lastId.get())));
eventBatch = inotifyEventInputStream.poll();
}
} catch (Throwable t) {
LOG.error("Inotify Apply Events error", t);
}
}
use of org.smartdata.model.SystemInfo in project SSM by Intel-bigdata.
the class TestMetaStore method testUpdateAndInsertSystemInfo.
@Test
public void testUpdateAndInsertSystemInfo() throws MetaStoreException {
SystemInfo systemInfo = new SystemInfo("test", "test");
metaStore.updateAndInsertIfNotExist(systemInfo);
Assert.assertTrue(metaStore.containSystemInfo("test"));
Assert.assertTrue(metaStore.getSystemInfoByProperty("test").equals(systemInfo));
}
Aggregations