Package cellmate.accumulo.parameters

Examples of cellmate.accumulo.parameters.AccumuloParameters


     * @param <C> cell type
     * @return list of cell groups generated.
     * @throws IllegalArgumentException if no table present or table not found.
     */
    public <C> List<CellGroup<C>> read(Parameters params, CellTransformer<Map.Entry<Key, Value>, C> transformer) {
        AccumuloParameters parameters = AccumuloParameterOps.checkParamType(params);
        Connector connector = AccumuloParameterOps.getConnectorFromParameters(instance, parameters);
        Authorizations auths = AccumuloParameterOps.getAuthsFromConnector(connector);
        if(log.isDebugEnabled())
            log.info("Create auths and connector for " + parameters.getUser());
        Scan scan = parameters.hasKey(AccumuloParameters.MULTI_RANGE) ?
                new MultiRangeScan(connector, auths, parameters) :
                new SingleRangeScan(connector, auths, parameters);
        if(log.isDebugEnabled())
            log.info("Setting up scan type: " + scan.getClass().getName());
        return read(scan.get(), parameters, transformer);
View Full Code Here


    @Test
    public void multiFamilyGetAsStrings(){

        try {
            AccumuloParameters localParams = builder.setColumns(new String[]{"info", "events"}).build();
            AccumuloDBResultReader reader =
                    new AccumuloDBResultReader(mockInstance);
            assertNotNull(reader);
            List<CellGroup<SecurityStringValueCell>> items =
                    reader.read(localParams, AccumuloCellTransformers.stringValueQualtoLabelWithColFam());
View Full Code Here

    public void iteratorAttachment() {
        try {

            IteratorSetting iter = new IteratorSetting(15, "regexfilter", RegExFilter.class);
            iter.addOption(RegExFilter.VALUE_REGEX, "brian");
            AccumuloParameters localParams = builder.setColumns(new String[]{"info:name"}).
                    addIteratorSetting(iter).build();
            AccumuloDBResultReader reader =
                    new AccumuloDBResultReader(mockInstance);
            assertNotNull(reader);
            List<CellGroup<SecurityStringValueCell>> items =
View Full Code Here

    }

    @Test
    public void singleFamilyGetAsStrings() {
        try {
            AccumuloParameters localParams = builder.setColumns(new String[]{"info"}).build();
            AccumuloDBResultReader reader =
                    new AccumuloDBResultReader(mockInstance);
            assertNotNull(reader);
            List<CellGroup<SecurityStringValueCell>> items =
                    reader.read(localParams, AccumuloCellTransformers.stringValueQualToLabelWithTime_ColVis_ColFam());
View Full Code Here

    }

    @Test
    public void restrictedQuals() {
        try {
            AccumuloParameters localParams = builder.setColumns(new String[]{"info:name"}).build();
            AccumuloDBResultReader reader =
                    new AccumuloDBResultReader(mockInstance);
            assertNotNull(reader);
            List<CellGroup<SecurityStringValueCell>> items =
                    reader.read(localParams, AccumuloCellTransformers.stringValueQualtoLabel());
View Full Code Here

    }

    @Test
    public void testRange() {
        try {
            AccumuloParameters localParams = builder.
                    setColumns(new String[]{"info"}).
                    setStartKey("row1").
                    setEndKey("row1").build();
            AccumuloDBResultReader reader =
                    new AccumuloDBResultReader(mockInstance);
View Full Code Here

    }

    @Test
    public void missingTable() {
        try {
            AccumuloParameters localParams = builder.setTable(null).build();
            AccumuloDBResultReader reader =
                    new AccumuloDBResultReader(mockInstance);
            assertNotNull(reader);
            reader.read(localParams, AccumuloCellTransformers.stringValueQualtoLabel());
            fail("reader should complain there is no table");
View Full Code Here

    @Test
    public void missingUser() {

        try {
            AccumuloParameters localParams = builder.setUser(null).build();
            AccumuloDBResultReader reader =
                    new AccumuloDBResultReader(mockInstance);
            assertNotNull(reader);
            reader.read(localParams, AccumuloCellTransformers.stringValueQualtoLabel());
            fail("reader should complain there is no user");
View Full Code Here

    }

    @Test
    public void malforedColFamEntry() {
        try {
            AccumuloParameters localParams = builder.setColumns(new String[]{"cf:blah:blah"}).build();
            AccumuloDBResultReader reader =
                    new AccumuloDBResultReader(mockInstance);
            assertNotNull(reader);
            reader.read(localParams, AccumuloCellTransformers.stringValueQualtoLabel());
            fail("reader should complain about malformed column family");
View Full Code Here

        }
    }

    @Test
    public void stringSecurityCellAll() {
        AccumuloParameters localParams = builder.setColumns(new String[]{"info"}).build();
        AccumuloDBResultReader reader = new AccumuloDBResultReader(mockInstance);
        assertNotNull(reader);
        List<CellGroup<SecurityStringValueCell>> items =
                reader.read(localParams, AccumuloCellTransformers.stringValueQualToLabelWithTime_ColVis_ColFam());
        assertNotNull(items);
View Full Code Here

TOP

Related Classes of cellmate.accumulo.parameters.AccumuloParameters

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.