Examples of ThunderGateCacheSupport


Examples of com.asakusafw.thundergate.runtime.cache.ThunderGateCacheSupport

        if (ThunderGateCacheSupport.class.isAssignableFrom(definition.getModelClass()) == false) {
            return null;
        }
        String columnName;
        try {
            ThunderGateCacheSupport support = definition.getModelClass()
                .asSubclass(ThunderGateCacheSupport.class)
                .newInstance();
            columnName = support.__tgc__TimestampColumn();
        } catch (Exception e) {
            LOG.warn(MessageFormat.format(
                    "テーブル{0}の最終更新時刻のカラム算出に失敗しました",
                    tableName), e);
            return null;
View Full Code Here

Examples of com.asakusafw.thundergate.runtime.cache.ThunderGateCacheSupport

        ModelLoader loader = generateJava();
        loader.setNamespace(Constants.SOURCE_TABLE);

        ModelWrapper object = loader.newModel("Simple");
        assertThat(object.unwrap(), instanceOf(ThunderGateCacheSupport.class));
        ThunderGateCacheSupport support = (ThunderGateCacheSupport) object.unwrap();

        object.set("sid", 123L);
        assertThat(support.__tgc__SystemId(), is(123L));
        assertThat(support.__tgc__TimestampColumn(), is("TIMESTAMP"));
        assertThat(support.__tgc__Deleted(), is(false));
    }
View Full Code Here

Examples of com.asakusafw.thundergate.runtime.cache.ThunderGateCacheSupport

        ModelLoader loader = generateJava();
        loader.setNamespace(Constants.SOURCE_TABLE);

        ModelWrapper object = loader.newModel("Simple");
        assertThat(object.unwrap(), instanceOf(ThunderGateCacheSupport.class));
        ThunderGateCacheSupport support = (ThunderGateCacheSupport) object.unwrap();

        object.set("delete", true);
        assertThat(support.__tgc__Deleted(), is(true));
        object.set("delete", false);
        assertThat(support.__tgc__Deleted(), is(false));
        object.setOption("delete", null);
        assertThat(support.__tgc__Deleted(), is(false));
    }
View Full Code Here

Examples of com.asakusafw.thundergate.runtime.cache.ThunderGateCacheSupport

            PatchApplyKey key,
            Iterable<ThunderGateCacheSupport> values,
            Context context) throws IOException, InterruptedException {
        Iterator<ThunderGateCacheSupport> iter = values.iterator();
        if (iter.hasNext()) {
            ThunderGateCacheSupport first = iter.next();
            context.write(key, first);
        }
    }
View Full Code Here

Examples of com.asakusafw.thundergate.runtime.cache.ThunderGateCacheSupport

            PatchApplyKey key,
            Iterable<ThunderGateCacheSupport> values,
            Context context) throws IOException, InterruptedException {
        Iterator<ThunderGateCacheSupport> iter = values.iterator();
        if (iter.hasNext()) {
            ThunderGateCacheSupport first = iter.next();
            if (first.__tgc__Deleted()) {
                // deleted
            } else {
                context.write(KEY, first);
            }
        }
View Full Code Here

Examples of com.asakusafw.thundergate.runtime.cache.ThunderGateCacheSupport

    public void cache() {
        ModelLoader loaded = generateJava("cache");
        ModelWrapper model = loaded.newModel("Model");

        assertThat(model.unwrap(), is(instanceOf(ThunderGateCacheSupport.class)));
        ThunderGateCacheSupport support = (ThunderGateCacheSupport) model.unwrap();

        model.set("sid", 100L);
        assertThat(support.__tgc__SystemId(), is(100L));
        assertThat(support.__tgc__TimestampColumn(), is("LAST_UPDT_DATETIME"));
        assertThat(support.__tgc__Deleted(), is(false));
    }
View Full Code Here

Examples of com.asakusafw.thundergate.runtime.cache.ThunderGateCacheSupport

    public void cache_delete() {
        ModelLoader loaded = generateJava("cache_delete");
        ModelWrapper model = loaded.newModel("Model");

        assertThat(model.unwrap(), is(instanceOf(ThunderGateCacheSupport.class)));
        ThunderGateCacheSupport support = (ThunderGateCacheSupport) model.unwrap();

        model.set("logical_delete_flag", new Text("Y"));
        assertThat(support.__tgc__Deleted(), is(true));
        model.set("logical_delete_flag", new Text("N"));
        assertThat(support.__tgc__Deleted(), is(false));
        model.set("logical_delete_flag", null);
        assertThat(support.__tgc__Deleted(), is(false));
    }
View Full Code Here

Examples of com.asakusafw.thundergate.runtime.cache.ThunderGateCacheSupport

    public void cache_delete_boolean() {
        ModelLoader loaded = generateJava("cache_delete_boolean");
        ModelWrapper model = loaded.newModel("Model");

        assertThat(model.unwrap(), is(instanceOf(ThunderGateCacheSupport.class)));
        ThunderGateCacheSupport support = (ThunderGateCacheSupport) model.unwrap();

        model.set("logical_delete_flag", true);
        assertThat(support.__tgc__Deleted(), is(true));
        model.set("logical_delete_flag", false);
        assertThat(support.__tgc__Deleted(), is(false));
        model.setOption("logical_delete_flag", null);
        assertThat(support.__tgc__Deleted(), is(false));
    }
View Full Code Here

Examples of com.asakusafw.thundergate.runtime.cache.ThunderGateCacheSupport

    public void cache_delete_integer() {
        ModelLoader loaded = generateJava("cache_delete_integer");
        ModelWrapper model = loaded.newModel("Model");

        assertThat(model.unwrap(), is(instanceOf(ThunderGateCacheSupport.class)));
        ThunderGateCacheSupport support = (ThunderGateCacheSupport) model.unwrap();

        model.set("logical_delete_flag", (byte) 1);
        assertThat(support.__tgc__Deleted(), is(true));
        model.set("logical_delete_flag", (byte) 0);
        assertThat(support.__tgc__Deleted(), is(false));
        model.set("logical_delete_flag", (byte) 2);
        assertThat(support.__tgc__Deleted(), is(false));
        model.setOption("logical_delete_flag", null);
        assertThat(support.__tgc__Deleted(), is(false));
    }
View Full Code Here

Examples of com.asakusafw.thundergate.runtime.cache.ThunderGateCacheSupport

            original = null;
        }
        if (tableInfo.getStartTimestamp() == null) {
            return original;
        } else {
            ThunderGateCacheSupport support;
            try {
                support = tableInfo
                    .getImportTargetType()
                    .asSubclass(ThunderGateCacheSupport.class)
                    .newInstance();
            } catch (Exception e) {
                throw new BulkLoaderSystemException(e, getClass(), "TG-IMPORTER-13002",
                        tableName,
                        tableInfo.getCacheId(),
                        tableInfo.getImportTargetType().getName());
            }
            String timestampColumn = support.__tgc__TimestampColumn();
            if (original == null) {
                return MessageFormat.format(
                        "{0}.{1} >= ?",
                        tableName,
                        timestampColumn);
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.