use of org.smartdata.server.metric.fetcher.InotifyEventFetcher in project SSM by Intel-bigdata.
the class StatesManager method init.
/**
* Load configure/data to initialize.
*
* @return true if initialized successfully
*/
public boolean init(DBAdapter dbAdapter) throws IOException {
LOG.info("Initializing ...");
this.cleanFileTableContents(dbAdapter);
String nnUri = conf.get(SmartConfKeys.DFS_SSM_NAMENODE_RPCSERVER_KEY);
try {
this.client = new DFSClient(new URI(nnUri), conf);
} catch (URISyntaxException e) {
throw new IOException(e);
}
this.executorService = Executors.newScheduledThreadPool(4);
this.accessCountTableManager = new AccessCountTableManager(dbAdapter, executorService);
this.fileAccessEventSource = MetricsFactory.createAccessEventSource(conf);
this.accessEventFetcher = new AccessEventFetcher(conf, accessCountTableManager, executorService, fileAccessEventSource.getCollector());
this.inotifyEventFetcher = new InotifyEventFetcher(client, dbAdapter, executorService);
LOG.info("Initialized.");
return true;
}
Aggregations