本文整理汇总了Java中org.apache.cassandra.db.SystemKeyspace.clearSSTableReadMeter方法的典型用法代码示例。如果您正苦于以下问题:Java SystemKeyspace.clearSSTableReadMeter方法的具体用法?Java SystemKeyspace.clearSSTableReadMeter怎么用?Java SystemKeyspace.clearSSTableReadMeter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cassandra.db.SystemKeyspace
的用法示例。
在下文中一共展示了SystemKeyspace.clearSSTableReadMeter方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import org.apache.cassandra.db.SystemKeyspace; //导入方法依赖的package包/类
public void run()
{
if (tracker != null)
tracker.notifyDeleting(referent);
if (referent.readMeter != null)
SystemKeyspace.clearSSTableReadMeter(referent.getKeyspaceName(), referent.getColumnFamilyName(), referent.descriptor.generation);
// If we can't successfully delete the DATA component, set the task to be retried later: see above
File datafile = new File(desc.filenameFor(Component.DATA));
if (!datafile.delete())
{
logger.error("Unable to delete " + datafile + " (it will be removed on server restart; we'll also retry after GC)");
failedTasks.add(this);
return;
}
// let the remainder be cleaned up by delete
SSTable.delete(desc, Sets.difference(components, Collections.singleton(Component.DATA)));
if (tracker != null)
tracker.spaceReclaimed(size);
}
示例2: run
import org.apache.cassandra.db.SystemKeyspace; //导入方法依赖的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: run
import org.apache.cassandra.db.SystemKeyspace; //导入方法依赖的package包/类
public void run()
{
if (tracker != null)
tracker.notifyDeleting(referent);
if (referent.readMeter != null)
SystemKeyspace.clearSSTableReadMeter(referent.getKeyspaceName(), referent.getColumnFamilyName(), referent.descriptor.generation);
// If we can't successfully delete the DATA component, set the task to be retried later: see above
File datafile = new File(desc.filenameFor(Component.DATA));
if (!datafile.delete())
{
logger.error("Unable to delete {} (it will be removed on server restart; we'll also retry after GC)", datafile);
failedTasks.add(this);
return;
}
// let the remainder be cleaned up by delete
SSTable.delete(desc, Sets.difference(components, Collections.singleton(Component.DATA)));
if (tracker != null)
tracker.spaceReclaimed(size);
}
示例4: tidy
import org.apache.cassandra.db.SystemKeyspace; //导入方法依赖的package包/类
public void tidy()
{
lookup.remove(desc);
if (readMeterSyncFuture != null)
readMeterSyncFuture.cancel(true);
if (isCompacted.get())
SystemKeyspace.clearSSTableReadMeter(desc.ksname, desc.cfname, desc.generation);
// don't ideally want to dropPageCache for the file until all instances have been released
CLibrary.trySkipCache(desc.filenameFor(Component.DATA), 0, 0);
CLibrary.trySkipCache(desc.filenameFor(Component.PRIMARY_INDEX), 0, 0);
}