Package org.apache.karaf.shell.commands.impl

Examples of org.apache.karaf.shell.commands.impl.SortAction$SortComparator$Key


    validateQuery(query);
    validateSplitSize(numSplits);

    List<Query> splits = new ArrayList<Query>(numSplits);
    List<Key> scatterKeys = getScatterKeys(numSplits, query, datastore);
    Key lastKey = null;
    for (Key nextKey : getSplitKey(scatterKeys, numSplits)) {
      splits.add(createSplit(lastKey, nextKey, query));
      lastKey = nextKey;
    }
    splits.add(createSplit(lastKey, null, query));
View Full Code Here


    public void testSortToStdout() throws Exception {
        String newLine = System.getProperty("line.separator");
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        byte[] input = ("abc" + newLine + "def" + newLine).getBytes();
        new SortAction().sort(new ByteArrayInputStream(input), new PrintStream(baos));
        assertEquals(new String(input), new String(baos.toByteArray()));
    }
View Full Code Here

        String newLine = System.getProperty("line.separator");
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        String inputString = "def" + newLine + "def" + newLine + "abc" + newLine + "abc" + newLine + "def" + newLine;
        byte[] input = inputString.getBytes();
        String outputString = ("abc" + newLine + "def" + newLine);
        SortAction sort = new SortAction();
        Field unique = SortAction.class.getDeclaredField("unique");
        unique.setAccessible(true);
        unique.set(sort, true);
        sort.sort(new ByteArrayInputStream(input), new PrintStream(baos));
        assertEquals(outputString, new String(baos.toByteArray()));
    }
View Full Code Here

TOP

Related Classes of org.apache.karaf.shell.commands.impl.SortAction$SortComparator$Key

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.