Examples of ImportBean


Examples of com.asakusafw.bulkloader.bean.ImportBean

        tableBean.setLockType(ImportTableLockType.RECORD);
        tableBean.setLockedOperation(ImportTableLockedOperation.ERROR);
        tableBean.setImportTargetType(null);
        tableBean.setDfsFilePath(null);
        targetTable.put("IMPORT_TARGET1", tableBean);
        ImportBean bean = createBean(new String[]{jobflowId, executionId, "20101021221015", "3", "1"}, targetTable);

        // テスト対象クラス実行
        TargetDataLock lock = new TargetDataLock();
        try {
            lock.lock(bean);
View Full Code Here

Examples of com.asakusafw.bulkloader.bean.ImportBean

        tableBean.setLockType(ImportTableLockType.NONE);
        tableBean.setLockedOperation(ImportTableLockedOperation.ERROR);
        tableBean.setImportTargetType(null);
        tableBean.setDfsFilePath(null);
        targetTable.put("IMPORT_TARGET1", tableBean);
        ImportBean bean = createBean(new String[]{jobflowId, executionId, "20101021221015", "3", "1"}, targetTable);

        // テスト対象クラス実行
        TargetDataLock lock = new TargetDataLock();
        try {
            lock.lock(bean);
View Full Code Here

Examples of com.asakusafw.bulkloader.bean.ImportBean

        tableBean.setLockType(ImportTableLockType.NONE);
        tableBean.setLockedOperation(ImportTableLockedOperation.ERROR);
        tableBean.setImportTargetType(null);
        tableBean.setDfsFilePath(null);
        targetTable.put("IMPORT_TARGET1", tableBean);
        ImportBean bean = createBean(new String[]{jobflowId, executionId, "20101021221015", "3", "1"}, targetTable);

        // テスト対象クラス実行
        TargetDataLock lock = new TargetDataLock();
        try {
            lock.lock(bean);
View Full Code Here

Examples of com.asakusafw.bulkloader.bean.ImportBean

        tableBean.setLockType(ImportTableLockType.RECORD);
        tableBean.setLockedOperation(ImportTableLockedOperation.OFF);
        tableBean.setImportTargetType(null);
        tableBean.setDfsFilePath(null);
        targetTable.put("IMPORT_TARGET1", tableBean);
        ImportBean bean = createBean(new String[]{jobflowId, executionId, "20101021221015", "3", "1"}, targetTable);

        // テスト対象クラス実行
        TargetDataLock lock = new TargetDataLock();
        boolean result = lock.lock(bean);
View Full Code Here

Examples of com.asakusafw.bulkloader.bean.ImportBean

     * @param args
     * @param targetTable
     * @return ImportBean
     */
    private static ImportBean createBean(String[] args, Map<String, ImportTargetTableBean> targetTable) {
        ImportBean bean = new ImportBean();
        // ターゲット名
        bean.setTargetName(targetName);
        // バッチID
        bean.setBatchId("BATCH01");
        // ジョブフローID
        bean.setJobflowId(args[0]);
        // ジョブフロー実行ID
        bean.setExecutionId(args[1]);
        // ジョブネットの終了予定時刻
        String date = args[2];
        Calendar cal = Calendar.getInstance();
        cal.clear();
        cal.set(Calendar.YEAR, Integer.parseInt(date.substring(0, 4)));
        cal.set(Calendar.MONTH, Integer.parseInt(date.substring(4, 6)) - 1);
        cal.set(Calendar.DATE, Integer.parseInt(date.substring(6, 8)));
        cal.set(Calendar.HOUR, Integer.parseInt(date.substring(8, 10)));
        cal.set(Calendar.MINUTE, Integer.parseInt(date.substring(10, 12)));
        cal.set(Calendar.SECOND, Integer.parseInt(date.substring(12, 14)));
        bean.setJobnetEndTime(cal.getTime());
        // リトライ回数・リトライインターバル
        bean.setRetryCount(Integer.parseInt(args[3]));
        bean.setRetryInterval(Integer.parseInt(args[4]));

        // テーブル毎の設定
        bean.setTargetTable(targetTable);

        return bean;
    }
View Full Code Here

Examples of com.asakusafw.bulkloader.bean.ImportBean

     * only normal contents.
     * @throws Exception if failed
     */
    @Test
    public void contents() throws Exception {
        ImportBean bean = createBean();
        Map<String, ImportTargetTableBean> targetTable = new HashMap<String, ImportTargetTableBean>();

        ImportTargetTableBean tb1 = new ImportTargetTableBean();
        tb1.setCacheId(null);
        tb1.setDfsFilePath("tb1");
        tb1.setImportTargetType(ImportTarget1.class);
        tb1.setImportTargetColumns(Arrays.asList("A"));
        tb1.setSearchCondition("");
        targetTable.put("__TG_TEST1", tb1);

        bean.setTargetTable(targetTable);
        ImportProtocolDecide service = new ImportProtocolDecide();
        service.execute(bean);

        assertThat(tb1.getImportProtocol().getKind(), is(FileProtocol.Kind.CONTENT));
        assertThat(tb1.getStartTimestamp(), is(nullValue()));
View Full Code Here

Examples of com.asakusafw.bulkloader.bean.ImportBean

     * Creates a new cache.
     * @throws Exception if failed
     */
    @Test
    public void create_cache() throws Exception {
        ImportBean bean = createBean();

        Map<String, ImportTargetTableBean> targetTable = new HashMap<String, ImportTargetTableBean>();

        ImportTargetTableBean tb1 = new ImportTargetTableBean();
        tb1.setCacheId("tb1");
        tb1.setDfsFilePath("tb1");
        tb1.setImportTargetType(ImportTarget1.class);
        tb1.setImportTargetColumns(Arrays.asList("A"));
        tb1.setSearchCondition("");
        targetTable.put("__TG_TEST1", tb1);

        bean.setTargetTable(targetTable);
        ImportProtocolDecide service = new ImportProtocolDecide() {
            @Override
            protected Map<String, CacheInfo> collectRemoteCacheInfo(ImportBean _)
                    throws BulkLoaderSystemException {
                return Collections.emptyMap();
View Full Code Here

Examples of com.asakusafw.bulkloader.bean.ImportBean

     * Updates a cache.
     * @throws Exception if failed
     */
    @Test
    public void update_cache() throws Exception {
        ImportBean bean = createBean();

        Map<String, ImportTargetTableBean> targetTable = new HashMap<String, ImportTargetTableBean>();

        final ImportTargetTableBean tb1 = new ImportTargetTableBean();
        tb1.setCacheId("tb1");
        tb1.setDfsFilePath("tb1");
        tb1.setImportTargetType(ImportTarget1.class);
        tb1.setImportTargetColumns(Arrays.asList("A"));
        tb1.setSearchCondition("");
        targetTable.put("__TG_TEST1", tb1);

        Connection conn = DBConnection.getConnection();
        try {
            LocalCacheInfoRepository repo = new LocalCacheInfoRepository(conn);
            repo.putCacheInfo(new LocalCacheInfo(
                    tb1.getCacheId(),
                    null,
                    null,
                    "__TG_TEST1",
                    tb1.getDfsFilePath()));

        } finally {
            DBConnection.closeConn(conn);
        }

        bean.setTargetTable(targetTable);
        ImportProtocolDecide service = new ImportProtocolDecide() {
            @Override
            protected Map<String, CacheInfo> collectRemoteCacheInfo(ImportBean _)
                    throws BulkLoaderSystemException {
                return Collections.singletonMap("tb1", new CacheInfo(
View Full Code Here

Examples of com.asakusafw.bulkloader.bean.ImportBean

     * Updates a cache.
     * @throws Exception if failed
     */
    @Test
    public void update_cache_rebuild() throws Exception {
        ImportBean bean = createBean();

        Map<String, ImportTargetTableBean> targetTable = new HashMap<String, ImportTargetTableBean>();

        final ImportTargetTableBean tb1 = new ImportTargetTableBean();
        tb1.setCacheId("tb1");
        tb1.setDfsFilePath("tb1");
        tb1.setImportTargetType(ImportTarget1.class);
        tb1.setImportTargetColumns(Arrays.asList("A"));
        tb1.setSearchCondition("");
        targetTable.put("__TG_TEST1", tb1);

        Connection conn = DBConnection.getConnection();
        final Calendar last = offset(-1);
        try {
            LocalCacheInfoRepository repo = new LocalCacheInfoRepository(conn);
            repo.putCacheInfo(new LocalCacheInfo(
                    tb1.getCacheId(),
                    null,
                    last,
                    "__TG_TEST1",
                    tb1.getDfsFilePath()));

        } finally {
            DBConnection.closeConn(conn);
        }

        bean.setTargetTable(targetTable);
        ImportProtocolDecide service = new ImportProtocolDecide() {
            @Override
            protected Map<String, CacheInfo> collectRemoteCacheInfo(ImportBean _)
                    throws BulkLoaderSystemException {
                return Collections.singletonMap("tb1", new CacheInfo(
View Full Code Here

Examples of com.asakusafw.bulkloader.bean.ImportBean

     * Updates a cache (DB may be rollbacked).
     * @throws Exception if failed
     */
    @Test
    public void update_cache_db_rollback() throws Exception {
        ImportBean bean = createBean();

        Map<String, ImportTargetTableBean> targetTable = new HashMap<String, ImportTargetTableBean>();

        final ImportTargetTableBean tb1 = new ImportTargetTableBean();
        tb1.setCacheId("tb1");
        tb1.setDfsFilePath("tb1");
        tb1.setImportTargetType(ImportTarget1.class);
        tb1.setImportTargetColumns(Arrays.asList("A"));
        tb1.setSearchCondition("");
        targetTable.put("__TG_TEST1", tb1);

        Connection conn = DBConnection.getConnection();
        try {
            LocalCacheInfoRepository repo = new LocalCacheInfoRepository(conn);
            repo.putCacheInfo(new LocalCacheInfo(
                    tb1.getCacheId(),
                    null,
                    null,
                    "__TG_TEST1",
                    tb1.getDfsFilePath()));

        } finally {
            DBConnection.closeConn(conn);
        }

        bean.setTargetTable(targetTable);
        ImportProtocolDecide service = new ImportProtocolDecide() {
            @Override
            protected Map<String, CacheInfo> collectRemoteCacheInfo(ImportBean _)
                    throws BulkLoaderSystemException {
                return Collections.singletonMap("tb1", new CacheInfo(
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.