Package cellmate.accumulo.reader

Examples of cellmate.accumulo.reader.AccumuloDBResultReader


    }

    @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);
        assertEquals(items.size(), 2);
        try {
            SecurityStringValueCell cell = extractor.getSingleCellByLabel(items.get(0).getInternalList(), "name");
View Full Code Here


    }

    @Test
    public void stringSecurityCellTimeColVis() {
        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());
        String colVis = null;
        long timestamp = 0l;
        try {
            SecurityStringValueCell cell = extractor.getSingleCellByLabel(items.get(0).getInternalList(), "name");
View Full Code Here

    }

    @Test
    public void stringSecurityCellColFam() {
        AccumuloParameters localParams = builder.setColumns(new String[]{"info"}).build();
        AccumuloDBResultReader reader = new AccumuloDBResultReader(mockInstance);
        assertNotNull(reader);
        List<CellGroup<SecurityStringValueCell>> items = reader.read(localParams, AccumuloCellTransformers.stringValueQualtoLabelWithColFam());
        String colFam = null;

        try {
            SecurityStringValueCell cell = extractor.getSingleCellByLabel(items.get(0).getInternalList(), "name");
View Full Code Here

    }

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

        try {
            SecurityStringValueCell cell = extractor.getSingleCellByLabel(items.get(0).getInternalList(), "name");

            String value = CellReflector.getValueAsString(cell);
View Full Code Here

    }

    @Test
    public void doubleSecurityCellLabelValue() {
        AccumuloParameters localParams = builder.setColumns(new String[]{"info:gpa"}).build();
        AccumuloDBResultReader reader =  new AccumuloDBResultReader(mockInstance);
        assertNotNull(reader);
        List<CellGroup<SecurityDoubleValueCell>> items = reader.read(localParams, AccumuloCellTransformers.doubleValueQualtoLabel());

        try {
            double value = extractor.getDoubleValueByLabel(items.get(0).getInternalList(), "gpa");
            assertNotNull(value);
            assertEquals(value, 3.7d);
View Full Code Here

    }

    @Test
    public void longSecurityCellLabelValue() {
        AccumuloParameters localParams = builder.setColumns(new String[]{"info:lm"}).build();
        AccumuloDBResultReader reader = new AccumuloDBResultReader(mockInstance);
        assertNotNull(reader);
        List<CellGroup<SecurityLongValueCell>> items = reader.read(localParams, AccumuloCellTransformers.longValueQualtoLabel());

        try {
            long value = extractor.getLongValueByLabel(items.get(0).getInternalList(), "lm");
            assertNotNull(value);
            assertEquals(value, 12345l);
View Full Code Here

    }

    @Test
    public void byteSecurityCellLabelValue() {
        AccumuloParameters localParams = builder.setColumns(new String[]{"info:name"}).build();
        AccumuloDBResultReader reader = new AccumuloDBResultReader(mockInstance);
        assertNotNull(reader);
        List<CellGroup<SecurityByteValueCell>> items = reader.read(localParams, AccumuloCellTransformers.bytesValueQualtoLabel());

        try {
            byte[] value = extractor.getBytesValueByLabel(items.get(0).getInternalList(), "name");
            assertNotNull(value);
            assertEquals(value, "brian".getBytes());
View Full Code Here

    }

    @Test
    public void intSecurityCellLabelValue() {
        AccumuloParameters localParams = builder.setColumns(new String[]{"info:age"}).build();
        AccumuloDBResultReader reader =  new AccumuloDBResultReader(mockInstance);
        assertNotNull(reader);
        List<CellGroup<SecurityIntValueCell>> items = reader.read(localParams, AccumuloCellTransformers.intValueQualtoLabel());

        try {
            int value = extractor.getIntValueByLabel(items.get(0).getInternalList(), "age");
            assertNotNull(value);
            assertEquals(value, 30);
View Full Code Here

    }

    @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));
        assertNotNull(items);
    }
View Full Code Here

TOP

Related Classes of cellmate.accumulo.reader.AccumuloDBResultReader

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.