Package com.asakusafw.runtime.directio

Examples of com.asakusafw.runtime.directio.Counter


    @Override
    public void cleanupAttemptOutput(OutputAttemptContext context) throws IOException, InterruptedException {
        if (context == null) {
            throw new IllegalArgumentException("context must not be null"); //$NON-NLS-1$
        }
        Counter counter = context.getCounter();
        heartbeat.register(counter);
        try {
            entity.cleanupAttemptOutput(context);
        } finally {
            heartbeat.unregister(counter);
View Full Code Here


    @Override
    public void setupTransactionOutput(OutputTransactionContext context) throws IOException, InterruptedException {
        if (context == null) {
            throw new IllegalArgumentException("context must not be null"); //$NON-NLS-1$
        }
        Counter counter = context.getCounter();
        heartbeat.register(counter);
        try {
            entity.setupTransactionOutput(context);
        } finally {
            heartbeat.unregister(counter);
View Full Code Here

    @Override
    public void commitTransactionOutput(OutputTransactionContext context) throws IOException, InterruptedException {
        if (context == null) {
            throw new IllegalArgumentException("context must not be null"); //$NON-NLS-1$
        }
        Counter counter = context.getCounter();
        heartbeat.register(counter);
        try {
            entity.commitTransactionOutput(context);
        } finally {
            heartbeat.unregister(counter);
View Full Code Here

    @Override
    public void cleanupTransactionOutput(OutputTransactionContext context) throws IOException,  InterruptedException {
        if (context == null) {
            throw new IllegalArgumentException("context must not be null"); //$NON-NLS-1$
        }
        Counter counter = context.getCounter();
        heartbeat.register(counter);
        try {
            entity.cleanupTransactionOutput(context);
        } finally {
            heartbeat.unregister(counter);
View Full Code Here

                conf,
                "testing",
                "testing",
                new Path(mapping.toURI()),
                new Path(temporary.toURI()));
        context = new OutputAttemptContext("tx", "atmpt", profile.getId(), new Counter());
    }
View Full Code Here

            OutputTransactionContext txContext = HadoopDataSourceUtil.createContext(executionId, id);
            OutputAttemptContext aContext = new OutputAttemptContext(
                    txContext.getTransactionId(),
                    String.valueOf(index),
                    txContext.getOutputId(),
                    new Counter());

            ds.setupTransactionOutput(txContext);
            ds.setupAttemptOutput(aContext);
            ModelOutput<StringBuilder> output = ds.openOutput(
                    aContext,
                    SimpleDataDefinition.newInstance(StringBuilder.class, new MockFormat()),
                    "",
                    executionId,
                    new Counter());
            try {
                output.write(new StringBuilder("Hello, world!"));
            } finally {
                output.close();
            }
View Full Code Here

                StringOption.class,
                fs,
                path,
                0,
                fs.getFileStatus(path).getLen(),
                new Counter());
        try {
            StringOption value = new StringOption();
            for (int i = 0; i < count; i++) {
                String answer = "Hello, world at " + i;
                assertThat(answer, in.readTo(value), is(true));
View Full Code Here

                        StringOption.class,
                        fs,
                        path,
                        offset,
                        length,
                        new Counter());
                try {
                    while (in.readTo(value)) {
                        String answer = "Hello, world at " + index;
                        assertThat(value.getAsString(), is(answer));
                        index++;
View Full Code Here

                    StringOption.class,
                    fs,
                    path,
                    offset,
                    length,
                    new Counter());
            try {
                while (in.readTo(value)) {
                    assertThat(value.get(), is(record));
                    index++;
                }
View Full Code Here

                StringOption.class,
                fs,
                path,
                0,
                fs.getFileStatus(path).getLen(),
                new Counter());
        try {
            assertThat("eof", in.readTo(new StringOption()), is(false));
        } finally {
            in.close();
        }
View Full Code Here

TOP

Related Classes of com.asakusafw.runtime.directio.Counter

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.