Examples of ExportTable


Examples of com.asakusafw.compiler.bulkloader.BulkLoaderScript.ExportTable

        BulkLoaderScript script = loadScript(info);
        assertThat(script.getImportTargetTables().size(), is(1));
        assertThat(script.getExportTargetTables().size(), is(1));

        ImportTable itable = script.getImportTargetTables().get(0);
        ExportTable etable = script.getExportTargetTables().get(0);
        assertThat(etable.getSources().size(), is(1));

        ModelOutput<Ex1> source = tester.openOutput(Ex1.class, itable.getDestination());
        Ex1 ex1 = new Ex1();
        ex1.setSid(200);
        ex1.setValue(1);
        source.write(ex1);
        ex1.setSid(300);
        ex1.setValue(2);
        source.write(ex1);
        ex1.setSid(100);
        ex1.setValue(3);
        source.write(ex1);
        source.close();

        assertThat(tester.runStages(info), is(true));

        Location resultLocation = etable.getSources().get(0);
        assertThat(resultLocation.isPrefix(), is(true));
        List<Ex1> results = tester.getList(Ex1.class, resultLocation);
        assertThat(results.size(), is(3));
        assertThat(results.get(0).getValue(), is(3));
        assertThat(results.get(1).getValue(), is(1));
View Full Code Here

Examples of com.asakusafw.compiler.bulkloader.BulkLoaderScript.ExportTable

        BulkLoaderScript script = loadScript(info);
        assertThat(script.getImportTargetTables().size(), is(1));
        assertThat(script.getExportTargetTables().size(), is(1));

        ImportTable itable = script.getImportTargetTables().get(0);
        ExportTable etable = script.getExportTargetTables().get(0);
        assertThat(etable.getSources().size(), is(1));

        ModelOutput<Ex1> source = tester.openOutput(Ex1.class, itable.getDestination());
        Ex1 ex1 = new Ex1();
        ex1.setSid(200);
        ex1.setValue(1);
        source.write(ex1);
        ex1.setSid(300);
        ex1.setValue(2);
        source.write(ex1);
        ex1.setSid(100);
        ex1.setValue(3);
        source.write(ex1);
        source.close();

        assertThat(tester.runStages(info), is(true));

        Location resultLocation = etable.getSources().get(0);
        assertThat(resultLocation.isPrefix(), is(true));
        List<Ex1> results = tester.getList(Ex1.class, resultLocation);
        assertThat(results.size(), is(3));
        assertThat(results.get(0).getValue(), is(3));
        assertThat(results.get(1).getValue(), is(1));
View Full Code Here

Examples of com.asakusafw.compiler.bulkloader.BulkLoaderScript.ExportTable

     */
    @Test
    public void exporters() {
        List<ImportTable> importers = Lists.create();
        List<ExportTable> exporters = Lists.create();
        exporters.add(new ExportTable(
                Ex1.class,
                "EX1",
                Arrays.asList("SID", "VALUE", "STRING", "LAST_UPDATE_TIME", "JOBFLOW_SID", "CACHE_FILE_SID"),
                Arrays.asList("VALUE", "STRING"),
                null,
                Collections.singletonList(Location.fromPath("ex1", '/'))));
        exporters.add(new ExportTable(
                Ex2.class,
                "EX2",
                Arrays.asList("SID", "VALUE", "STRING", "LAST_UPDATE_TIME", "JOBFLOW_SID", "CACHE_FILE_SID", "ERROR"),
                Arrays.asList("VALUE", "STRING"),
                new DuplicateRecordErrorTable(
View Full Code Here

Examples of com.asakusafw.compiler.bulkloader.BulkLoaderScript.ExportTable

    private ExportTable convert(OutputDescription output) {
        assert output != null;
        BulkLoadExporterDescription desc = extract(output);
        DuplicateRecordCheck duplicate = desc.getDuplicateRecordCheck();
        if (duplicate == null) {
            return new ExportTable(
                    desc.getModelType(),
                    desc.getTableName(),
                    desc.getColumnNames(),
                    desc.getTargetColumnNames(),
                    null,
                    Collections.singletonList(getOutputLocation(output)));
        } else {
            return new ExportTable(
                    desc.getModelType(),
                    desc.getTableName(),
                    desc.getColumnNames(),
                    desc.getTargetColumnNames(),
                    new DuplicateRecordErrorTable(
View Full Code Here

Examples of org.apache.accumulo.master.tableOps.ExportTable

        String namespaceId = Tables.getNamespaceId(master.getInstance(), tableId);
       
        if (!master.security.canExport(c, tableId, tableName, exportDir, namespaceId))
          throw new ThriftSecurityException(c.getPrincipal(), SecurityErrorCode.PERMISSION_DENIED);

        master.fate.seedTransaction(opid, new TraceRepo<Master>(new ExportTable(tableName, tableId, exportDir)), autoCleanup);
        break;
      }
      default:
        throw new UnsupportedOperationException();
    }
View Full Code Here

Examples of org.apache.accumulo.server.master.tableOps.ExportTable

          if (!security.canExport(c, tableId))
            throw new ThriftSecurityException(c.getPrincipal(), SecurityErrorCode.PERMISSION_DENIED);
         
          checkNotMetadataTable(tableName, TableOperation.EXPORT);
         
          fate.seedTransaction(opid, new TraceRepo<Master>(new ExportTable(tableName, tableId, exportDir)), autoCleanup);
          break;
        }
       
        default:
          throw new UnsupportedOperationException();
View Full Code Here

Examples of org.apache.accumulo.server.master.tableOps.ExportTable

          if (!security.canExport(c, tableId))
            throw new ThriftSecurityException(c.getPrincipal(), SecurityErrorCode.PERMISSION_DENIED);
         
          checkNotMetadataTable(tableName, TableOperation.EXPORT);
         
          fate.seedTransaction(opid, new TraceRepo<Master>(new ExportTable(tableName, tableId, exportDir)), autoCleanup);
          break;
        }
       
        default:
          throw new UnsupportedOperationException();
View Full Code Here

Examples of org.apache.accumulo.server.master.tableOps.ExportTable

          if (!security.canExport(c, tableId))
            throw new ThriftSecurityException(c.getPrincipal(), SecurityErrorCode.PERMISSION_DENIED);
         
          checkNotMetadataTable(tableName, TableOperation.EXPORT);
         
          fate.seedTransaction(opid, new TraceRepo<Master>(new ExportTable(tableName, tableId, exportDir)), autoCleanup);
          break;
        }
       
        default:
          throw new UnsupportedOperationException();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.