protected byte[] getIndexerConf(OptionSet options, OptionSpec<String> readerOption, OptionSpec<String> configOption, Map<String, String> connectionParams) throws IOException { String componentFactory = readerOption.value(options); String fileName = configOption.value(options); byte[] data = null; if (fileName != null) { File file = new File(fileName); if (!file.exists()) { StringBuilder msg = new StringBuilder(); msg.append("Specified indexer configuration file not found:\n"); msg.append(file.getAbsolutePath()); throw new CliException(msg.toString()); } data = ByteStreams.toByteArray(Files.newInputStreamSupplier(file).getInput()); try { IndexerComponentFactoryUtil .getComponentFactory(componentFactory, new ByteArrayInputStream(data), connectionParams); } catch (IndexerConfException e) { StringBuilder msg = new StringBuilder(); msg.append("Failed to parse configuration ").append(fileName).append('\n'); addExceptionMessages(e, msg); throw new CliException(msg.toString()); } } return data; }
protected byte[] getIndexerConf(OptionSet options, OptionSpec<String> readerOption, OptionSpec<String> configOption, Map<String, String> connectionParams) throws IOException { String componentFactory = readerOption.value(options); String fileName = configOption.value(options); byte[] data = null; if (fileName != null) { File file = new File(fileName); if (!file.exists()) { StringBuilder msg = new StringBuilder(); msg.append("Specified indexer configuration file not found:\n"); msg.append(file.getAbsolutePath()); throw new CliException(msg.toString()); } data = ByteStreams.toByteArray(Files.newInputStreamSupplier(file).getInput()); try { IndexerComponentFactoryUtil .getComponentFactory(componentFactory, new ByteArrayInputStream(data), connectionParams); } catch (IndexerConfException e) { StringBuilder msg = new StringBuilder(); msg.append("Failed to parse configuration ").append(fileName).append('\n'); addExceptionMessages(e, msg); throw new CliException(msg.toString()); } } return data; }
IndexerComponentFactory factory = IndexerComponentFactoryUtil.getComponentFactory(indexerComponentFactory, new ByteArrayInputStream(indexConfiguration.getBytes(Charsets.UTF_8)), indexConnectionParams); IndexerConf indexerConf = factory.createIndexerConf();
IndexerComponentFactory factory = IndexerComponentFactoryUtil.getComponentFactory(indexerComponentFactory, new ByteArrayInputStream(indexConfiguration.getBytes(Charsets.UTF_8)), indexConnectionParams); IndexerConf indexerConf = factory.createIndexerConf();
private String fetchIndexerTableName(String indexerName) throws Exception{ // best effort since this could be a pattern ... IndexerDefinition indexerDefinition = get(indexerName); IndexerComponentFactory factory = IndexerComponentFactoryUtil.getComponentFactory(indexerDefinition.getIndexerComponentFactory(), new ByteArrayInputStream(indexerDefinition.getConfiguration()), indexerDefinition.getConnectionParams()); String tableName = factory.createIndexerConf().getTable(); // TODO we should fail if the table does not exist return tableName; }
private String fetchIndexerTableName(String indexerName) throws Exception{ // best effort since this could be a pattern ... IndexerDefinition indexerDefinition = get(indexerName); IndexerComponentFactory factory = IndexerComponentFactoryUtil.getComponentFactory(indexerDefinition.getIndexerComponentFactory(), new ByteArrayInputStream(indexerDefinition.getConfiguration()), indexerDefinition.getConnectionParams()); String tableName = factory.createIndexerConf().getTable(); // TODO we should fail if the table does not exist return tableName; }
IndexerComponentFactory factory = IndexerComponentFactoryUtil.getComponentFactory(hbaseIndexerComponentFactory, is, indexConnectionParams); IndexerConf indexerConf = factory.createIndexerConf(); applyMorphLineParams(indexerConf);
IndexerComponentFactory factory = IndexerComponentFactoryUtil.getComponentFactory(hbaseIndexerComponentFactory, is, indexConnectionParams); IndexerConf indexerConf = factory.createIndexerConf(); applyMorphLineParams(indexerConf);
IndexerComponentFactory factory = IndexerComponentFactoryUtil.getComponentFactory(indexDef.getIndexerComponentFactory(), new ByteArrayInputStream(indexDef.getConfiguration()), indexDef.getConnectionParams()); factory.configure(new ByteArrayInputStream(indexerConfXml), indexDef.getConnectionParams()); indexerConf = factory.createIndexerConf();
IndexingSpecification indexingSpec = indexingOpts.getIndexingSpecification(); IndexerComponentFactory factory = IndexerComponentFactoryUtil.getComponentFactory(indexingSpec.getIndexerComponentFactory(), new ByteArrayInputStream(indexingSpec.getConfiguration()), Maps.<String, String>newHashMap()); IndexerConf indexerConf = factory.createIndexerConf();
IndexingSpecification indexingSpec = indexingOpts.getIndexingSpecification(); IndexerComponentFactory factory = IndexerComponentFactoryUtil.getComponentFactory(indexingSpec.getIndexerComponentFactory(), new ByteArrayInputStream(indexingSpec.getConfiguration()), Maps.<String, String>newHashMap()); IndexerConf indexerConf = factory.createIndexerConf();
@VisibleForTesting void evaluateScan() { this.scans = Lists.newArrayList(); IndexerComponentFactory factory = IndexerComponentFactoryUtil.getComponentFactory(hbaseIndexingSpecification.getIndexerComponentFactory(), new ByteArrayInputStream(hbaseIndexingSpecification.getConfiguration()), hbaseIndexingSpecification.getIndexConnectionParams()); IndexerConf indexerConf = factory.createIndexerConf(); applyMorphLineParams(indexerConf);
@VisibleForTesting void evaluateScan() { this.scans = Lists.newArrayList(); IndexerComponentFactory factory = IndexerComponentFactoryUtil.getComponentFactory(hbaseIndexingSpecification.getIndexerComponentFactory(), new ByteArrayInputStream(hbaseIndexingSpecification.getConfiguration()), hbaseIndexingSpecification.getIndexConnectionParams()); IndexerConf indexerConf = factory.createIndexerConf(); applyMorphLineParams(indexerConf);
HBaseIndexerMapper.configureIndexConnectionParams(conf, indexingSpec.getIndexConnectionParams()); IndexerComponentFactory factory = IndexerComponentFactoryUtil.getComponentFactory(indexingSpec.getIndexerComponentFactory(), new ByteArrayInputStream(indexingSpec.getConfiguration()), indexingSpec.getIndexConnectionParams()); IndexerConf indexerConf = factory.createIndexerConf();
HBaseIndexerMapper.configureIndexConnectionParams(conf, indexingSpec.getIndexConnectionParams()); IndexerComponentFactory factory = IndexerComponentFactoryUtil.getComponentFactory(indexingSpec.getIndexerComponentFactory(), new ByteArrayInputStream(indexingSpec.getConfiguration()), indexingSpec.getIndexConnectionParams()); IndexerConf indexerConf = factory.createIndexerConf();
IndexerComponentFactory factory = IndexerComponentFactoryUtil.getComponentFactory(indexerDef.getIndexerComponentFactory(), new ByteArrayInputStream(indexerDef.getConfiguration()), indexerDef.getConnectionParams()); IndexerConf indexerConf = factory.createIndexerConf();
IndexerComponentFactory factory = IndexerComponentFactoryUtil.getComponentFactory(indexerDef.getIndexerComponentFactory(), new ByteArrayInputStream(indexerDef.getConfiguration()), indexerDef.getConnectionParams()); IndexerConf indexerConf = factory.createIndexerConf();
IndexerComponentFactory factory = IndexerComponentFactoryUtil.getComponentFactory(indexer.getIndexerComponentFactory(), new ByteArrayInputStream(indexer.getConfiguration()), indexer.getConnectionParams()); IndexerConf indexerConf = factory.createIndexerConf(); if (indexerConf.tableNameIsRegex()) {