@@ -0,0 +1,2917 @@
+/*%0A * Licensed to the Apache Software Foundation (ASF) under one%0A * or more contributor license agreements.  See the NOTICE file%0A * distributed with this work for additional information%0A * regarding copyright ownership.  The ASF licenses this file%0A * to you under the Apache License, Version 2.0 (the%0A * %22License%22); you may not use this file except in compliance%0A * with the License.  You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.apache.cassandra.db;%0A%0Aimport java.util.Map;%0Aimport javax.management.openmbean.*;%0A%0Aimport com.google.common.base.Throwables;%0Aimport org.apache.cassandra.io.util.FileUtils;%0Aimport org.apache.cassandra.utils.Pair;%0A%0A%0A%0A%0Apublic class SnapshotDetailsTabularData%0A%7B%0A%0A    private static final String%5B%5D ITEM_NAMES = new String%5B%5D%7B%22Snapshot name%22,%0A            %22Keyspace name%22,%0A            %22Column family name%22,%0A            %22True size%22,%0A            %22Size on disk%22%7D;%0A%0A    private static final String%5B%5D ITEM_DESCS = new String%5B%5D%7B%22snapshot_name%22,%0A            %22keyspace_name%22,%0A            %22columnfamily_name%22,%0A            %22TrueDiskSpaceUsed%22,%0A            %22TotalDiskSpaceUsed%22%7D;%0A%0A    private static final String TYPE_NAME = %22SnapshotDetails%22;%0A%0A    private static final String ROW_DESC = %22SnapshotDetails%22;%0A%0A    private static final OpenType%3C?%3E%5B%5D ITEM_TYPES;%0A%0A    private static final CompositeType COMPOSITE_TYPE;%0A%0A    public static final TabularType TABULAR_TYPE;%0A%0A    static%0A    %7B%0A        try%0A        %7B%0A            ITEM_TYPES = new OpenType%5B%5D%7B SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING %7D;%0A%0A            COMPOSITE_TYPE = new CompositeType(TYPE_NAME, ROW_DESC, ITEM_NAMES, ITEM_DESCS, ITEM_TYPES);%0A%0A            TABULAR_TYPE = new TabularType(TYPE_NAME, ROW_DESC, COMPOSITE_TYPE, ITEM_NAMES);%0A        %7D%0A        catch (OpenDataException e)%0A        %7B%0A            throw Throwables.propagate(e);%0A        %7D%0A    %7D%0A%0A%0A    public static void from(final String snapshot, final String ks, final String cf, Map.Entry%3CString, Pair%3CLong,Long%3E%3E snapshotDetail, TabularDataSupport result)%0A    %7B%0A        try%0A        %7B%0A            final String totalSize = FileUtils.stringifyFileSize(snapshotDetail.getValue().left);%0A            final String liveSize =  FileUtils.stringifyFileSize(snapshotDetail.getValue().right);%0A            result.put(new CompositeDataSupport(COMPOSITE_TYPE, ITEM_NAMES,%0A                    new Object%5B%5D%7B snapshot, ks, cf, liveSize, totalSize %7D));%0A        %7D%0A        catch (OpenDataException e)%0A        %7B%0A            throw new RuntimeException(e);%0A        %7D%0A    %7D%0A%7D%0A

add SnapshotDetailsTabularData.java