当前位置: 首页>>代码示例>>Java>>正文


Java SSTableFormat.Type方法代码示例

本文整理汇总了Java中org.apache.cassandra.io.sstable.format.SSTableFormat.Type方法的典型用法代码示例。如果您正苦于以下问题:Java SSTableFormat.Type方法的具体用法?Java SSTableFormat.Type怎么用?Java SSTableFormat.Type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.cassandra.io.sstable.format.SSTableFormat的用法示例。


在下文中一共展示了SSTableFormat.Type方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: Descriptor

import org.apache.cassandra.io.sstable.format.SSTableFormat; //导入方法依赖的package包/类
public Descriptor(Version version, String directory, String ksname, String cfname, int generation,
                  SSTableFormat.Type formatType, Component digestComponent, Configuration configuration)
{
    assert version != null && directory != null && ksname != null && cfname != null &&
            formatType.info.getLatestVersion().getClass().equals(version.getClass());

    this.version = version;
    this.directory = directory;
    this.ksname = ksname;
    this.cfname = cfname;
    this.generation = generation;
    this.formatType = formatType;
    this.digestComponent = digestComponent;
    this.conf = configuration;

    hashCode = Objects.hashCode(version, this.directory, generation, ksname, cfname, formatType);
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:18,代码来源:Descriptor.java

示例2: FileMessageHeader

import org.apache.cassandra.io.sstable.format.SSTableFormat; //导入方法依赖的package包/类
public FileMessageHeader(UUID cfId,
                         int sequenceNumber,
                         Version version,
                         SSTableFormat.Type format,
                         long estimatedKeys,
                         List<Pair<Long, Long>> sections,
                         CompressionInfo compressionInfo,
                         long repairedAt,
                         int sstableLevel,
                         SerializationHeader.Component header)
{
    this.cfId = cfId;
    this.sequenceNumber = sequenceNumber;
    this.version = version;
    this.format = format;
    this.estimatedKeys = estimatedKeys;
    this.sections = sections;
    this.compressionInfo = compressionInfo;
    this.compressionMetadata = null;
    this.repairedAt = repairedAt;
    this.sstableLevel = sstableLevel;
    this.header = header;
    this.size = calculateSize();
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:25,代码来源:FileMessageHeader.java

示例3: deserialize

import org.apache.cassandra.io.sstable.format.SSTableFormat; //导入方法依赖的package包/类
public FileMessageHeader deserialize(DataInputPlus in, int version) throws IOException
{
    UUID cfId = UUIDSerializer.serializer.deserialize(in, MessagingService.current_version);
    int sequenceNumber = in.readInt();
    Version sstableVersion = DatabaseDescriptor.getSSTableFormat().info.getVersion(in.readUTF());

    SSTableFormat.Type format = SSTableFormat.Type.LEGACY;
    if (version >= StreamMessage.VERSION_22)
        format = SSTableFormat.Type.validate(in.readUTF());

    long estimatedKeys = in.readLong();
    int count = in.readInt();
    List<Pair<Long, Long>> sections = new ArrayList<>(count);
    for (int k = 0; k < count; k++)
        sections.add(Pair.create(in.readLong(), in.readLong()));
    CompressionInfo compressionInfo = CompressionInfo.serializer.deserialize(in, MessagingService.current_version);
    long repairedAt = in.readLong();
    int sstableLevel = in.readInt();
    SerializationHeader.Component header = version >= StreamMessage.VERSION_30 && sstableVersion.storeRows()
                                         ? SerializationHeader.serializer.deserialize(sstableVersion, in)
                                         : null;

    return new FileMessageHeader(cfId, sequenceNumber, sstableVersion, format, estimatedKeys, sections, compressionInfo, repairedAt, sstableLevel, header);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:25,代码来源:FileMessageHeader.java

示例4: Descriptor

import org.apache.cassandra.io.sstable.format.SSTableFormat; //导入方法依赖的package包/类
public Descriptor(Version version, File directory, String ksname, String cfname, int generation, SSTableFormat.Type formatType, Component digestComponent)
{
    assert version != null && directory != null && ksname != null && cfname != null && formatType.info.getLatestVersion().getClass().equals(version.getClass());
    this.version = version;
    try
    {
        this.directory = directory.getCanonicalFile();
    }
    catch (IOException e)
    {
        throw new IOError(e);
    }
    this.ksname = ksname;
    this.cfname = cfname;
    this.generation = generation;
    this.formatType = formatType;
    this.digestComponent = digestComponent;

    hashCode = Objects.hashCode(version, this.directory, generation, ksname, cfname, formatType);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:21,代码来源:Descriptor.java

示例5: createSSTableWriter

import org.apache.cassandra.io.sstable.format.SSTableFormat; //导入方法依赖的package包/类
public static SSTableWriter createSSTableWriter(final Descriptor inputSSTableDescriptor,
                                                final CFMetaData outCfmMetaData,
                                                final SSTableReader inputSSTable) {
    final String sstableDirectory = System.getProperty("user.dir") + "/cassandra/compresseddata";
    LOGGER.info("Output directory: " + sstableDirectory);

    final File outputDirectory = new File(sstableDirectory + File.separatorChar
            + inputSSTableDescriptor.ksname
            + File.separatorChar + inputSSTableDescriptor.cfname);

    if (!outputDirectory.exists() && !outputDirectory.mkdirs()) {
        throw new FSWriteError(new IOException("failed to create tmp directory"),
                outputDirectory.getAbsolutePath());
    }

    final SSTableFormat.Type sstableFormat = SSTableFormat.Type.BIG;

    final BigTableWriter writer = new BigTableWriter(
            new Descriptor(
                    sstableFormat.info.getLatestVersion().getVersion(),
                    outputDirectory.getAbsolutePath(),
                    inputSSTableDescriptor.ksname, inputSSTableDescriptor.cfname,
                    inputSSTableDescriptor.generation,
                    sstableFormat,
                    inputSSTableDescriptor.getConfiguration()),
            inputSSTable.getTotalRows(), 0L, outCfmMetaData,
            new MetadataCollector(outCfmMetaData.comparator)
                    .sstableLevel(inputSSTable.getSSTableMetadata().sstableLevel),
            new SerializationHeader(true,
                    outCfmMetaData, outCfmMetaData.partitionColumns(),
                    org.apache.cassandra.db.rows.EncodingStats.NO_STATS));

    return writer;
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:35,代码来源:SSTableUtils.java

示例6: createWriter

import org.apache.cassandra.io.sstable.format.SSTableFormat; //导入方法依赖的package包/类
protected SSTableMultiWriter createWriter(ColumnFamilyStore cfs, long totalSize, long repairedAt, SSTableFormat.Type format) throws IOException
{
    Directories.DataDirectory localDir = cfs.getDirectories().getWriteableLocation(totalSize);
    if (localDir == null)
        throw new IOException("Insufficient disk space to store " + totalSize + " bytes");
    desc = Descriptor.fromFilename(cfs.getSSTablePath(cfs.getDirectories().getLocationForDisk(localDir), format));

    return cfs.createSSTableMultiWriter(desc, estimatedKeys, repairedAt, sstableLevel, getHeader(cfs.metadata), session.getTransaction(cfId));
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:10,代码来源:StreamReader.java

示例7: withFormatType

import org.apache.cassandra.io.sstable.format.SSTableFormat; //导入方法依赖的package包/类
public Descriptor withFormatType(SSTableFormat.Type newType)
{
    return new Descriptor(newType.info.getLatestVersion(), directory, ksname, cfname, generation, newType,
            digestComponent, conf);
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:6,代码来源:Descriptor.java

示例8: fromFilename

import org.apache.cassandra.io.sstable.format.SSTableFormat; //导入方法依赖的package包/类
public static Descriptor fromFilename(String filename, SSTableFormat.Type formatType, Configuration configuration)
{
    return fromFilename(filename, configuration).withFormatType(formatType);
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:5,代码来源:Descriptor.java

示例9: getSSTableFormat

import org.apache.cassandra.io.sstable.format.SSTableFormat; //导入方法依赖的package包/类
public static SSTableFormat.Type getSSTableFormat()
{
    return sstable_format;
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:5,代码来源:DatabaseDescriptor.java

示例10: setSSTableFormatType

import org.apache.cassandra.io.sstable.format.SSTableFormat; //导入方法依赖的package包/类
protected void setSSTableFormatType(SSTableFormat.Type type)
{
    this.formatType = type;
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:5,代码来源:AbstractSSTableSimpleWriter.java

示例11: createDescriptor

import org.apache.cassandra.io.sstable.format.SSTableFormat; //导入方法依赖的package包/类
private static Descriptor createDescriptor(File directory, final String keyspace, final String columnFamily, final SSTableFormat.Type fmt)
{
    int maxGen = getNextGeneration(directory, columnFamily);
    return new Descriptor(directory, keyspace, columnFamily, maxGen + 1, fmt);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:6,代码来源:AbstractSSTableSimpleWriter.java

示例12: withFormatType

import org.apache.cassandra.io.sstable.format.SSTableFormat; //导入方法依赖的package包/类
public Descriptor withFormatType(SSTableFormat.Type newType)
{
    return new Descriptor(newType.info.getLatestVersion(), directory, ksname, cfname, generation, newType, digestComponent);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:5,代码来源:Descriptor.java

示例13: fromFilename

import org.apache.cassandra.io.sstable.format.SSTableFormat; //导入方法依赖的package包/类
public static Descriptor fromFilename(String filename, SSTableFormat.Type formatType)
{
    return fromFilename(filename).withFormatType(formatType);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:5,代码来源:Descriptor.java


注:本文中的org.apache.cassandra.io.sstable.format.SSTableFormat.Type方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。