public static DescribeTimeseriesAnalyticalStoreResponse createDescribeTimeseriesAnalyticalStoreResponse()

in tablestore/src/main/java/com/alicloud/openservices/tablestore/core/protocol/timeseries/TimeseriesResponseFactory.java [432:486]


    public static DescribeTimeseriesAnalyticalStoreResponse createDescribeTimeseriesAnalyticalStoreResponse(
            ResponseContentWithMeta meta, Timeseries.DescribeTimeseriesAnalyticalStoreResponse pbResponse) {
        DescribeTimeseriesAnalyticalStoreResponse response = new DescribeTimeseriesAnalyticalStoreResponse(meta.getMeta());

        if (pbResponse.hasAnalyticalStore()) {
            Timeseries.TimeseriesAnalyticalStore pbAnalyticalStore = pbResponse.getAnalyticalStore();
            TimeseriesAnalyticalStore analyticalStore = new TimeseriesAnalyticalStore(pbAnalyticalStore.getStoreName());
            if (pbAnalyticalStore.hasTimeToLive()) {
                analyticalStore.setTimeToLive(pbAnalyticalStore.getTimeToLive());
            }
            if (pbAnalyticalStore.hasSyncOption()) {
                switch (pbAnalyticalStore.getSyncOption()) {
                    case SYNC_TYPE_FULL:
                        analyticalStore.setSyncOption(AnalyticalStoreSyncType.SYNC_TYPE_FULL);
                        break;
                    case SYNC_TYPE_INCR:
                        analyticalStore.setSyncOption(AnalyticalStoreSyncType.SYNC_TYPE_INCR);
                        break;
                }
            }
            response.setAnalyticalStore(analyticalStore);
        }

        if (pbResponse.hasStorageSize()) {
            Timeseries.AnalyticalStoreStorageSize pbStorageSize = pbResponse.getStorageSize();
            AnalyticalStoreStorageSize storageSize = new AnalyticalStoreStorageSize();
            if (pbStorageSize.hasSize()) {
                storageSize.setSizeInBytes(pbStorageSize.getSize());
            }
            if (pbStorageSize.hasTimestamp()) {
                storageSize.setTimestamp(pbStorageSize.getTimestamp());
            }
            response.setStorageSize(storageSize);
        }

        if (pbResponse.hasSyncStat()) {
            Timeseries.AnalyticalStoreSyncStat pbSyncStat = pbResponse.getSyncStat();
            AnalyticalStoreSyncStat syncStat = new AnalyticalStoreSyncStat();
            if (pbSyncStat.hasCurrentSyncTimestamp()) {
                syncStat.setCurrentSyncTimestamp(pbSyncStat.getCurrentSyncTimestamp());
            }
            if (pbSyncStat.hasSyncPhase()) {
                switch (pbSyncStat.getSyncPhase()) {
                    case SYNC_TYPE_FULL:
                        syncStat.setSyncPhase(AnalyticalStoreSyncType.SYNC_TYPE_FULL);
                        break;
                    case SYNC_TYPE_INCR:
                        syncStat.setSyncPhase(AnalyticalStoreSyncType.SYNC_TYPE_INCR);
                        break;
                }
            }
            response.setSyncStat(syncStat);
        }
        return response;
    }