Search in sources :

Example 1 with AccumuloBuilder

use of org.apache.rya.export.api.conf.AccumuloMergeConfiguration.AccumuloBuilder in project incubator-rya by apache.

the class AccumuloConfigurationAdapter method createConfig.

/**
 * @param genConfig - The JAXB generated configuration.
 * @return The {@link MergeConfiguration} used in the application
 * @throws MergeConfigurationException
 */
@Override
public MergeConfiguration createConfig(final MergeToolConfiguration genConfig) throws MergeConfigurationException {
    final AccumuloMergeToolConfiguration aConfig = (AccumuloMergeToolConfiguration) genConfig;
    final DBType parentType = aConfig.getParentDBType();
    final DBType childType = aConfig.getChildDBType();
    final MergeConfiguration.Builder configBuilder = super.getBuilder(aConfig);
    final AccumuloBuilder builder = new AccumuloBuilder(configBuilder);
    if (parentType == DBType.ACCUMULO) {
        verifyParentInstanceType(aConfig);
        builder.setParentZookeepers(aConfig.getParentZookeepers()).setParentAuths(aConfig.getParentAuths()).setParentInstanceType(aConfig.getParentInstanceType());
    }
    if (childType == DBType.ACCUMULO) {
        verifyChildInstanceType(aConfig);
        builder.setChildZookeepers(aConfig.getChildZookeepers()).setChildAuths(aConfig.getChildAuths()).setChildInstanceType(aConfig.getChildInstanceType());
    }
    return builder.build();
}
Also used : AccumuloMergeToolConfiguration(org.apache.rya.export.AccumuloMergeToolConfiguration) AccumuloBuilder(org.apache.rya.export.api.conf.AccumuloMergeConfiguration.AccumuloBuilder) DBType(org.apache.rya.export.DBType)

Aggregations

AccumuloMergeToolConfiguration (org.apache.rya.export.AccumuloMergeToolConfiguration)1 DBType (org.apache.rya.export.DBType)1 AccumuloBuilder (org.apache.rya.export.api.conf.AccumuloMergeConfiguration.AccumuloBuilder)1