本文整理汇总了Java中org.apache.cassandra.io.sstable.SSTable.delete方法的典型用法代码示例。如果您正苦于以下问题:Java SSTable.delete方法的具体用法?Java SSTable.delete怎么用?Java SSTable.delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cassandra.io.sstable.SSTable
的用法示例。
在下文中一共展示了SSTable.delete方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: cleanup
import org.apache.cassandra.io.sstable.SSTable; //导入方法依赖的package包/类
public void cleanup()
{
List<String> files = readLockfile(lockfile);
for (String file : files)
{
try
{
Descriptor desc = Descriptor.fromFilename(file, true);
SSTable.delete(desc, SSTable.componentsFor(desc));
}
catch (Exception e)
{
JVMStabilityInspector.inspectThrowable(e);
logger.warn("failed to delete a potentially stale sstable {}", file);
}
}
}
示例2: run
import org.apache.cassandra.io.sstable.SSTable; //导入方法依赖的package包/类
public void run()
{
SystemKeyspace.clearSSTableReadMeter(desc.ksname, desc.cfname, desc.generation);
try
{
// If we can't successfully delete the DATA component, set the task to be retried later: see TransactionTidier
File datafile = new File(desc.filenameFor(Component.DATA));
delete(datafile);
// let the remainder be cleaned up by delete
SSTable.delete(desc, SSTable.discoverComponentsFor(desc));
}
catch (Throwable t)
{
logger.error("Failed deletion for {}, we'll retry after GC and on server restart", desc);
failedDeletions.add(this);
return;
}
if (tracker != null && tracker.cfstore != null && !wasNew)
tracker.cfstore.metric.totalDiskSpaceUsed.dec(sizeOnDisk);
// release the referent to the parent so that the all transaction files can be released
parentRef.release();
}
示例3: cleanup
import org.apache.cassandra.io.sstable.SSTable; //导入方法依赖的package包/类
public void cleanup()
{
List<String> files = readLockfile(lockfile);
for (String file : files)
{
try
{
Descriptor desc = Descriptor.fromFilename(file, true);
SSTable.delete(desc, SSTable.componentsFor(desc));
}
catch (Exception e)
{
logger.warn("failed to delete a potentially stale sstable {}", file);
}
}
}
示例4: run
import org.apache.cassandra.io.sstable.SSTable; //导入方法依赖的package包/类
public void run()
{
logger.info("SSTableTidier is running..");
//if (tracker != null && !tracker.isDummy())
// SystemKeyspace.clearSSTableReadMeter(desc.ksname, desc.cfname, desc.generation);
try
{
// If we can't successfully delete the DATA component, set the task to be retried later: see TransactionTidier
File datafile = new File(desc.filenameFor(Component.DATA));
if (datafile.exists())
delete(datafile);
else if (!wasNew)
logger.error("SSTableTidier ran with no existing data file for an sstable that was not new");
// let the remainder be cleaned up by delete
SSTable.delete(desc, SSTable.discoverComponentsFor(desc));
}
catch (Throwable t)
{
logger.error("Failed deletion for {}, we'll retry after GC and on server restart", desc);
failedDeletions.add(this);
return;
}
//if (tracker != null && tracker.cfstore != null && !wasNew)
// tracker.cfstore.metric.totalDiskSpaceUsed.dec(sizeOnDisk);
// release the referent to the parent so that the all transaction files can be released
parentRef.release();
}