Search in sources :

Example 1 with InotifyEventFetcher

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;
}
Also used : DFSClient(org.apache.hadoop.hdfs.DFSClient) AccessEventFetcher(org.smartdata.server.metric.fetcher.AccessEventFetcher) AccessCountTableManager(org.smartdata.server.metastore.tables.AccessCountTableManager) URISyntaxException(java.net.URISyntaxException) IOException(java.io.IOException) InotifyEventFetcher(org.smartdata.server.metric.fetcher.InotifyEventFetcher) URI(java.net.URI)

Aggregations

IOException (java.io.IOException)1 URI (java.net.URI)1 URISyntaxException (java.net.URISyntaxException)1 DFSClient (org.apache.hadoop.hdfs.DFSClient)1 AccessCountTableManager (org.smartdata.server.metastore.tables.AccessCountTableManager)1 AccessEventFetcher (org.smartdata.server.metric.fetcher.AccessEventFetcher)1 InotifyEventFetcher (org.smartdata.server.metric.fetcher.InotifyEventFetcher)1