Examples of CacheInfo


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

     * cache information exists.
     * @throws Exception if failed
     */
    @Test
    public void found() throws Exception {
        CacheInfo info = new CacheInfo(
                "a",
                "id",
                calendar("2011-12-13 14:15:16"),
                "EXAMPLE",
                Collections.singleton("COL"),
View Full Code Here

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

     * multiple requests.
     * @throws Exception if failed
     */
    @Test
    public void mixed() throws Exception {
        CacheInfo info = new CacheInfo(
                "a",
                "id",
                calendar("2011-12-13 14:15:16"),
                "EXAMPLE",
                Collections.singleton("COL"),
View Full Code Here

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

                if (cacheId == null) {
                    assert tableInfo.getImportProtocol() != null;
                    continue;
                }

                CacheInfo currentRemoteInfo = map.get(tableInfo.getDfsFilePath());
                Calendar startTimestamp = computeStartTimestamp(currentRemoteInfo, repository, tableName, tableInfo);

                tableInfo.setStartTimestamp(startTimestamp);
                LocalCacheInfo nextLocalInfo = new LocalCacheInfo(
                        cacheId,
                        null,
                        startTimestamp,
                        tableName,
                        tableInfo.getDfsFilePath());

                ThunderGateCacheSupport model = createDataModelObject(tableName, tableInfo);
                Calendar nextTimestamp = repository.putCacheInfo(nextLocalInfo);
                CacheInfo nextRemoteInfo = new CacheInfo(
                        CacheInfo.FEATURE_VERSION,
                        cacheId,
                        nextTimestamp,
                        tableName,
                        tableInfo.getImportTargetColumns(),
View Full Code Here

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

     * Creates a new cache.
     * @throws Exception if failed
     */
    @Test
    public void create() throws Exception {
        CacheInfo info = new CacheInfo(
                "a",
                "id",
                calendar("2011-12-13 14:15:16"),
                "EXAMPLE",
                Collections.singleton("COL"),
View Full Code Here

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

     * Creates a new cache with some deleted values.
     * @throws Exception if failed
     */
    @Test
    public void create_deleted() throws Exception {
        CacheInfo info = new CacheInfo(
                "a",
                "id",
                calendar("2011-12-13 14:15:16"),
                "EXAMPLE",
                Collections.singleton("COL"),
View Full Code Here

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

     * Update a cache.
     * @throws Exception if failed
     */
    @Test
    public void update() throws Exception {
        CacheInfo info = new CacheInfo(
                "a",
                "id",
                calendar("2011-12-13 14:15:16"),
                "EXAMPLE",
                Collections.singleton("COL"),
View Full Code Here

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

     * Update a cache.
     * @throws Exception if failed
     */
    @Test
    public void update_delete() throws Exception {
        CacheInfo info = new CacheInfo(
                "a",
                "id",
                calendar("2011-12-13 14:15:16"),
                "EXAMPLE",
                Collections.singleton("COL"),
View Full Code Here

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

        bean.setTargetTable(targetTable);
        ImportProtocolDecide service = new ImportProtocolDecide() {
            @Override
            protected Map<String, CacheInfo> collectRemoteCacheInfo(ImportBean _)
                    throws BulkLoaderSystemException {
                return Collections.singletonMap("tb1", new CacheInfo(
                        CacheInfo.FEATURE_VERSION,
                        tb1.getCacheId(),
                        last,
                        "__TG_TEST1",
                        tb1.getImportTargetColumns(),
                        tb1.getImportTargetType().getName(),
                        new ImportTarget1().__tgc__DataModelVersion()));
            }
        };
        service.execute(bean);

        assertThat(tb1.getImportProtocol().getKind(), is(FileProtocol.Kind.UPDATE_CACHE));
        assertThat(tb1.getImportProtocol().getLocation(), is(tb1.getDfsFilePath()));
        assertThat(tb1.getStartTimestamp(), is(notNullValue()));
        CacheInfo info = tb1.getImportProtocol().getInfo();
        assertThat(info, is(notNullValue()));

        assertThat(info.getId(), is("tb1"));
        assertThat(info.getFeatureVersion(), is(CacheInfo.FEATURE_VERSION));
        assertThat(info.getTimestamp(), is(not(nullValue())));
        assertThat(info.getTableName(), is("__TG_TEST1"));
        assertThat(info.getColumnNames(), is((Object) new HashSet<String>(tb1.getImportTargetColumns())));
        assertThat(info.getModelClassName(), is(ImportTarget1.class.getName()));
        assertThat(info.getModelClassVersion(), is(new ImportTarget1().__tgc__DataModelVersion()));
    }
View Full Code Here

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

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

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

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