public void open() throws IOException { if (isOpen) { return; // silently return } try { tbl = EagleConfigFactory.load().getHTable(this.table); } catch (RuntimeException ex) { throw new IOException(ex); } isOpen = true; }
private EagleConfigFactory() { init(); if (this.getStorageType() == null || this.getStorageType().equalsIgnoreCase("hbase")) { this.pool = new HTablePool(this.hbaseConf, 10); } }
this.zkPort = config.hasPath(EagleConfigConstants.SERVICE_HBASE_ZOOKEEPER_PROPERTY_CLIENTPORT) ? config.getString(EagleConfigConstants.SERVICE_HBASE_ZOOKEEPER_PROPERTY_CLIENTPORT): null; String zkZnodeParent = config.hasPath(EagleConfigConstants.SERVICE_ZOOKEEPER_ZNODE_PARENT)? config.getString(EagleConfigConstants.SERVICE_ZOOKEEPER_ZNODE_PARENT): EagleConfigConstants.DEFAULT_ZOOKEEPER_ZNODE_PARENT; String clientIPCPoolSize = getString(config, EagleConfigConstants.SERVICE_HBASE_CLIENT_IPC_POOL_SIZE, "10"); this.hbaseConf = HBaseConfiguration.create();
@Override public void open() throws IOException { try{ tbl = EagleConfigFactory.load().getHTable(this.table); // LOGGER.info("HBase table " + table + " audo reflush is " + (tbl.isAutoFlush() ? "enabled" : "disabled")); }catch(Exception ex){ LOG.error("Cannot create htable", ex); throw new IOException(ex); } }
private EagleConfigFactory(){ init(); if(this.getStorageType() == null || this.getStorageType().equalsIgnoreCase("hbase")) { this.pool = new HTablePool(this.hbaseConf, 10); } }
final String zkZnodeParent = config.hasPath(EagleConfigConstants.SERVICE_ZOOKEEPER_ZNODE_PARENT) ? config.getString(EagleConfigConstants.SERVICE_ZOOKEEPER_ZNODE_PARENT) : EagleConfigConstants.DEFAULT_ZOOKEEPER_ZNODE_PARENT; String clientIPCPoolSize = getString(config, EagleConfigConstants.SERVICE_HBASE_CLIENT_IPC_POOL_SIZE, "10"); this.autoCreateTable = !config.hasPath(EagleConfigConstants.AUTO_CREATE_TABLE) || config.getBoolean(EagleConfigConstants.AUTO_CREATE_TABLE); this.hbaseConf = HBaseConfiguration.create();
@Override public void open() throws IOException { try { tbl = EagleConfigFactory.load().getHTable(this.table); // LOGGER.info("HBase table " + table + " audo reflush is " + (tbl.isAutoFlush() ? "enabled" : // "disabled")); } catch (Exception ex) { LOG.error("Cannot create htable", ex); throw new IOException(ex); } }
@Override public void open() throws IOException { try { tbl = EagleConfigFactory.load().getHTable(this.table); } catch (RuntimeException ex) { throw new IOException(ex); } }
@Override public void open() throws IOException { try{ tbl = EagleConfigFactory.load().getHTable(this.table); }catch(RuntimeException ex){ throw new IOException(ex); } }
public long getTimestampFromDate(String dateStr) throws ParseException { SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_PATTERN); sdf.setTimeZone(EagleConfigFactory.load().getTimeZone()); Date d = sdf.parse(dateStr); return d.getTime(); }
public void open() throws IOException { if (isOpen) return; // silently return try { tbl = EagleConfigFactory.load().getHTable(this.table); } catch (RuntimeException ex) { throw new IOException(ex); } isOpen = true; }
/** * Check if audit is required based on the service names and audit configuration. * @param serviceName: Name of the service call. * @return */ private boolean isAuditingRequired (String serviceName) { if (EagleConfigFactory.load().isServiceAuditingEnabled() // As per jira EAGLE-47, HBase operation level audit is done only for Policy, Site and DataSource definitions. && ("AlertDefinitionService".equals(serviceName) || "AlertDataSourceService".equals(serviceName))) { return true; } return false; }
/** * Check if audit is required based on the service names and audit configuration. * * @param serviceName: Name of the service call. * @return */ private boolean isAuditingRequired(String serviceName) { if (EagleConfigFactory.load().isServiceAuditingEnabled() // As per jira EAGLE-47, HBase operation level audit is done only for Policy, Site and DataSource definitions. && ("AlertDefinitionService".equals(serviceName) || "AlertDataSourceService".equals(serviceName))) { return true; } return false; }
@GET @Produces(MediaType.APPLICATION_JSON) public EagleServiceSelfCheckAPIEntity selfCheck(){ EagleServiceSelfCheckAPIEntity entity = new EagleServiceSelfCheckAPIEntity(); entity.setHbaseZookeeperQuorum(EagleConfigFactory.load().getZKQuorum()); entity.setHbaseZookeeperClientPort(EagleConfigFactory.load().getZKPort()); entity.setEnv(EagleConfigFactory.load().getEnv()); return entity; } }
@GET @Produces(MediaType.APPLICATION_JSON) public EagleServiceSelfCheckAPIEntity selfCheck(){ EagleServiceSelfCheckAPIEntity entity = new EagleServiceSelfCheckAPIEntity(); entity.setHBaseZookeeperQuorum(EagleConfigFactory.load().getZKQuorum()); entity.setHBaseZookeeperClientPort(EagleConfigFactory.load().getZKPort()); entity.setEnv(EagleConfigFactory.load().getEnv()); return entity; } }
Date date = new Date(startTime); SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd%20HH:mm:ss"); dateFormatter.setTimeZone(EagleConfigFactory.load().getTimeZone()); String timeString = dateFormatter.format(date); sb.append("&startTime=").append(timeString);
private LdapService(){ EagleConfig manager = EagleConfigFactory.load(); securityPrincipal = manager.getConfig().getString(SECURITY_PRINCIPAL_CONFIG_NAME); securityCredentials = manager.getConfig().getString(SECURITY_CREDENTIALS_CONFIG_NAME);
Date date = new Date(startTime); SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd%20HH:mm:ss"); dateFormatter.setTimeZone(EagleConfigFactory.load().getTimeZone()); String timeString = dateFormatter.format(date); sb.append("&startTime=").append(timeString);
private LdapService() { EagleConfig manager = EagleConfigFactory.load(); securityPrincipal = manager.getConfig().getString(SECURITY_PRINCIPAL_CONFIG_NAME); securityCredentials = manager.getConfig().getString(SECURITY_CREDENTIALS_CONFIG_NAME);
@Override public void readAsStream() throws Exception { // populate listeners to all readers for (EntityCreationListener l : listeners) { for (GenericEntityStreamReader r : readers) { r.register(l); } } List<Future<Void>> futures = new ArrayList<Future<Void>>(); for (GenericEntityStreamReader r : readers) { SingleReader reader = new SingleReader(r); Future<Void> readFuture = EagleConfigFactory.load().getExecutor().submit(reader); futures.add(readFuture); } // join threads and check exceptions for (Future<Void> future : futures) { try { future.get(); } catch (Exception ex) { LOG.error("Error in read", ex); throw ex; } } }