Package cellmate.accumulo.parameters

Examples of cellmate.accumulo.parameters.AccumuloParameters$Builder


        }
    }

    @Test
    public void commonLabelFlatteningIfNecessary() {
       AccumuloParameters localParams = builder.setColumns(new String[]{"events", "info"}).build();
       AccumuloDBResultReader reader = new AccumuloDBResultReader(mockInstance);
        assertNotNull(reader);
        Map<String, String> commonLabels = new HashMap<String, String>();
        commonLabels.put("events", "event");
        List<CellGroup<SecurityStringValueCell>> items = reader.read(localParams, AccumuloCellTransformers.colFamToCommonLabelOnMatches(commonLabels));
View Full Code Here


    }


    @Test
    public void countTotalKeyValues() {
        AccumuloParameters localParams = builder.setColumns(new String[]{"info"}).build();
        AccumuloAggregateDBResultReader reader = new AccumuloAggregateDBResultReader(mockInstance);
        assertNotNull(reader);
        List<CellGroup<IntValueCell>> items = reader.read(localParams, AccumuloCellTransformers.totalKeyValueCount());
        assertNotNull(items);
        assertEquals(items.size(), 1);
View Full Code Here

        }
    }

    @Test
    public void countDistinctRows() {
        AccumuloParameters localParams = builder.setColumns(new String[]{"info"}).build();
        AccumuloAggregateDBResultReader reader = new AccumuloAggregateDBResultReader (mockInstance);
        assertNotNull(reader);
        List<CellGroup<IntValueCell>> items = reader.read(localParams, AccumuloCellTransformers.distinctRowIDCount());
        assertNotNull(items);
        assertEquals(items.size(), 1);
View Full Code Here

     * @throws CellExtractorException if an error occurs in the DBItemTransformer
     */
    public <C> ImmutableList<Mutation> write(Iterable<CellGroup<C>> groups,
                                         Parameters params,
                                         DBItemTransformer<Mutation,C> transformer) throws CellExtractorException {
        AccumuloParameters parameters = AccumuloParameterOps.checkParamType(params);
        Connector connector = AccumuloParameterOps.getConnectorFromParameters(instance, parameters);
        try {
            BatchWriter writer = connector.createBatchWriter(parameters.getTableName(),
                    parameters.getMaxWriteMemory(),
                    parameters.getMaxWriteLatency(),
                    parameters.getMaxWriteThreads());
            ImmutableList<Mutation> items = baseWriter.write(groups, parameters, transformer);
            writer.addMutations(items);
            writer.close();
            return items;
        } catch (NoSuchElementException e){
            throw new IllegalArgumentException("Missing table name in parameters");
        } catch (TableNotFoundException e) {
            throw new IllegalArgumentException("Table not found during read: " + parameters.getTableName(),e);
        } catch (MutationsRejectedException e) {
            throw new CellExtractorException("Accumulo mutations were rejected", e, ErrorType.REJECTED_WRITE);
        }
    }
View Full Code Here

TOP

Related Classes of cellmate.accumulo.parameters.AccumuloParameters$Builder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.