org.apache.cassandra.io.util.FileUtils.closeQuietly()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(173)

本文整理了Java中org.apache.cassandra.io.util.FileUtils.closeQuietly()方法的一些代码示例,展示了FileUtils.closeQuietly()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtils.closeQuietly()方法的具体详情如下:
包路径:org.apache.cassandra.io.util.FileUtils
类名称:FileUtils
方法名:closeQuietly

FileUtils.closeQuietly介绍

暂无

代码示例

代码示例来源:origin: Netflix/Priam

public ClearCredential() {
  FileInputStream fis = null;
  try {
    fis = new FileInputStream(CRED_FILE);
    final Properties props = new Properties();
    props.load(fis);
    AWS_ACCESS_ID =
        props.getProperty("AWSACCESSID") != null
            ? props.getProperty("AWSACCESSID").trim()
            : "";
    AWS_KEY = props.getProperty("AWSKEY") != null ? props.getProperty("AWSKEY").trim() : "";
  } catch (Exception e) {
    logger.error("Exception with credential file ", e);
    throw new RuntimeException("Problem reading credential file. Cannot start.", e);
  } finally {
    FileUtils.closeQuietly(fis);
  }
}

代码示例来源:origin: Netflix/Priam

public StaticMembership() throws IOException {
  Properties config = new Properties();
  FileInputStream fis = null;
  try {
    fis = new FileInputStream(DEFAULT_PROP_PATH);
    config.load(fis);
  } catch (Exception e) {
    logger.error("Exception with static membership file ", e);
    throw new RuntimeException("Problem reading static membership file. Cannot start.", e);
  } finally {
    FileUtils.closeQuietly(fis);
  }
  String racName = config.getProperty(RAC_NAME);
  racCount = 0;
  for (String name : config.stringPropertyNames()) {
    if (name.startsWith(INSTANCES_PRE)) {
      racCount += 1;
      if (name.equals(INSTANCES_PRE + racName))
        racMembership = Arrays.asList(config.getProperty(name).split(","));
    }
  }
}

代码示例来源:origin: Netflix/Priam

private void writeCassandraSnitchProperties() {
  final NodeType nodeType = dseConfig.getNodeType();
  if (nodeType == NodeType.REAL_TIME_QUERY) return;
  Reader reader = null;
  try {
    String filePath = config.getCassHome() + "/conf/" + RACKDC_PROPERTY_FILENAME;
    reader = new FileReader(filePath);
    Properties properties = new Properties();
    properties.load(reader);
    String suffix = "";
    if (nodeType == NodeType.SEARCH) suffix = "_solr";
    if (nodeType == NodeType.ANALYTIC_HADOOP) suffix = "_hadoop";
    if (nodeType == NodeType.ANALYTIC_HADOOP_SPARK) suffix = "_hadoop_spark";
    if (nodeType == NodeType.ANALYTIC_SPARK) suffix = "_spark";
    properties.put("dc_suffix", suffix);
    properties.store(new FileWriter(filePath), "");
  } catch (Exception e) {
    throw new RuntimeException("Unable to read " + RACKDC_PROPERTY_FILENAME, e);
  } finally {
    FileUtils.closeQuietly(reader);
  }
}

代码示例来源:origin: Netflix/Priam

FileUtils.closeQuietly(writer);

代码示例来源:origin: Impetus/Kundera

accessFilename, e.getMessage()));
} finally {
  FileUtils.closeQuietly(in);

代码示例来源:origin: org.apache.cassandra/cassandra-all

public void close()
{
  FileUtils.closeQuietly(dataFile);
  FileUtils.closeQuietly(indexFile);
}

代码示例来源:origin: jsevellec/cassandra-unit

public void close() throws IOException
  {
    for (RangeIterator<K, D> range : ranges)
      FileUtils.closeQuietly(range);
  }
}

代码示例来源:origin: jsevellec/cassandra-unit

public void close() throws IOException
{
  FileUtils.closeQuietly(indexFile);
}

代码示例来源:origin: Impetus/Kundera

FileUtils.closeQuietly(in);

代码示例来源:origin: jsevellec/cassandra-unit

public void close()
{
  FileUtils.closeQuietly(union);
  referencedIndexes.forEach(TermIterator::releaseQuietly);
  referencedIndexes.clear();
}

代码示例来源:origin: org.apache.cassandra/cassandra-all

public void close()
{
  FileUtils.closeQuietly(union);
  referencedIndexes.forEach(TermIterator::releaseQuietly);
  referencedIndexes.clear();
}

代码示例来源:origin: com.netflix.sstableadaptor/sstable-adaptor-cassandra

public void close()
{
  // This will close the input iterators
  FileUtils.closeQuietly(mergeIterator);
  if (listener != null)
    listener.close();
}

代码示例来源:origin: jsevellec/cassandra-unit

public void close()
{
  // This will close the input iterators
  FileUtils.closeQuietly(mergeIterator);
  if (listener != null)
    listener.close();
}

代码示例来源:origin: com.strapdata.cassandra/cassandra-all

public void close()
{
  if (overlappingSSTables != null)
    overlappingSSTables.release();
  FileUtils.closeQuietly(openDataFiles.values());
  openDataFiles.clear();
}

代码示例来源:origin: org.apache.cassandra/cassandra-all

public void close()
{
  if (overlappingSSTables != null)
    overlappingSSTables.release();
  FileUtils.closeQuietly(openDataFiles.values());
  openDataFiles.clear();
}

代码示例来源:origin: org.apache.cassandra/cassandra-all

public void close()
{
  // This will close the input iterators
  FileUtils.closeQuietly(mergeIterator);
  if (listener != null)
    listener.close();
}

代码示例来源:origin: org.apache.cassandra/cassandra-all

public void close()
  {
    FileUtils.closeQuietly(operationTree);
    controller.finish();
  }
}

代码示例来源:origin: com.strapdata.cassandra/cassandra-all

public void release()
{
  int n = references.decrementAndGet();
  if (n == 0)
  {
    FileUtils.closeQuietly(index);
    sstableRef.release();
    if (obsolete.get() || sstableRef.globalCount() == 0)
      FileUtils.delete(index.getIndexPath());
  }
}

代码示例来源:origin: org.apache.cassandra/cassandra-all

public void release()
{
  int n = references.decrementAndGet();
  if (n == 0)
  {
    FileUtils.closeQuietly(index);
    sstableRef.release();
    if (obsolete.get() || sstableRef.globalCount() == 0)
      FileUtils.delete(index.getIndexPath());
  }
}

代码示例来源:origin: jsevellec/cassandra-unit

public void release()
{
  int n = references.decrementAndGet();
  if (n == 0)
  {
    FileUtils.closeQuietly(index);
    sstableRef.release();
    if (obsolete.get() || sstableRef.globalCount() == 0)
      FileUtils.delete(index.getIndexPath());
  }
}

相关文章