Package com.asakusafw.runtime.directio

Examples of com.asakusafw.runtime.directio.OutputAttemptContext


                            "Start directio task cleanup for datasource: datasource={0} job={1}, task={2}",
                            id,
                            taskContext.getJobID(),
                            taskContext.getTaskAttemptID()));
                }
                OutputAttemptContext context = HadoopDataSourceUtil.createContext(taskContext, id);
                try {
                    DirectDataSource repo = repository.getRelatedDataSource(containerPath);
                    repo.cleanupAttemptOutput(context);
                } catch (IOException e) {
                    LOG.error(MessageFormat.format(
                            "Failed directio task cleanup: datasource={0} (job={1}, task={2})",
                            id,
                            taskContext.getJobID(),
                            taskContext.getTaskAttemptID()), e);
                    throw e;
                } catch (InterruptedException e) {
                    throw (IOException) new InterruptedIOException(MessageFormat.format(
                            "Interrupted while cleanup attempt: {0}, {1} (path={2})",
                            context.getTransactionId(),
                            context.getAttemptId(),
                            containerPath)).initCause(e);
                }
                context.getCounter().add(1);
            }
        }
View Full Code Here


     * Test method for setupAttemptOutput.
     * @throws Exception if failed
     */
    @Test
    public void testSetupAttemptOutput() throws Exception {
        OutputAttemptContext context = context();
        long s1 = counter.count;
        ds.setupAttemptOutput(context);
        long s2 = counter.count;
        assertThat(s2, greaterThan(s1));
        assertKeepAlive(false);
View Full Code Here

     * Test method for commitAttemptOutput.
     * @throws Exception if failed
     */
    @Test
    public void testCommitAttemptOutput() throws Exception {
        OutputAttemptContext context = context();
        long s1 = counter.count;
        ds.commitAttemptOutput(context);
        long s2 = counter.count;
        assertThat(s2, greaterThan(s1));
        assertKeepAlive(false);
View Full Code Here

     * Test method for cleanupAttemptOutput.
     * @throws Exception if failed
     */
    @Test
    public void testCleanupAttemptOutput() throws Exception {
        OutputAttemptContext context = context();
        long s1 = counter.count;
        ds.cleanupAttemptOutput(context);
        long s2 = counter.count;
        assertThat(s2, greaterThan(s1));
        assertKeepAlive(false);
View Full Code Here

     * Test method for setupTransactionOutput.
     * @throws Exception if failed
     */
    @Test
    public void testSetupTransactionOutput() throws Exception {
        OutputAttemptContext context = context();
        long s1 = counter.count;
        ds.setupTransactionOutput(context.getTransactionContext());
        long s2 = counter.count;
        assertThat(s2, greaterThan(s1));
        assertKeepAlive(false);
    }
View Full Code Here

     * Test method for commitTransactionOutput.
     * @throws Exception if failed
     */
    @Test
    public void testCommitTransactionOutput() throws Exception {
        OutputAttemptContext context = context();
        long s1 = counter.count;
        ds.commitTransactionOutput(context.getTransactionContext());
        long s2 = counter.count;
        assertThat(s2, greaterThan(s1));
        assertKeepAlive(false);
    }
View Full Code Here

     * Test method for cleanupTransactionOutput.
     * @throws Exception if failed
     */
    @Test
    public void testCleanupTransactionOutput() throws Exception {
        OutputAttemptContext context = context();
        long s1 = counter.count;
        ds.cleanupTransactionOutput(context.getTransactionContext());
        long s2 = counter.count;
        assertThat(s2, greaterThan(s1));
        assertKeepAlive(false);
    }
View Full Code Here

        assertThat(s2, greaterThan(s1));
        assertKeepAlive(false);
    }

    private OutputAttemptContext context() {
        return new OutputAttemptContext("tx", "at", "o", counter);
    }
View Full Code Here

TOP

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

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.