Code Monkey home page Code Monkey logo

cassandra-utils's People

Contributors

arobinson-r7 avatar athompson-r7 avatar fmitchell-r7 avatar fpedrini avatar jpatrickr7 avatar onefrankguy avatar rvanburen-r7 avatar simonirwin-r7 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cassandra-utils's Issues

Autoclean tokens file always reads as empty

In v0.3.2, the token_cache method creates a new File in create, read, write, truncate mode. This means the file is always "empty" when cached_tokens is called. Instead, we should be creating the file with a custom mode, and caching the File object.

def token_cache
  mode = File::CREAT | File::RDWR | File::SYNC
  @token_cache ||= File.new(token_cache_path, mode)
end

That will create the file if it doesn't already exist, open the file for reading and writing, and allow us to eliminate the flush call when writing tokens.

We also need to call File.seek before reading tokens so that we read them from the beginning of the file.

token_cache.seek 0
token_cache.read

And we need to call File.seek and File.truncate before writing tokens so we overwrite any existing data in the file.

token_cache.seek 0
token_cache.truncate 0
token_cache.write data.to_json

Allow running stats and/or autoclean

cassandra-utils runs both stats and autoclean (automatic cleanup scheduling). It'd be nice to allow users to run stats and autoclean independently if desired. This could either be a series of command line switches e.g. --no-autoclean and --no-stats or a config file with a list of tasks to run.

Compaction and cleanup stats aren't being reported

In version 0.3.1-beta-2 the compaction and cleanup stats are no longer being reported.

This was broken in PR #18 when Mixlib::ShellOut was changed to DaemonRunner::ShellOut. The Cassandra::Utils::CLI::Base#run! method wasn't changed, so it's still trying to call Mixlib::ShellOut#run_command and Mixlib::ShellOut#error! instead of DaemonRunner::ShellOut#run!.

Interestingly, there don't appear to be any errors or warnings in the logs about missing method calls. We should look into what's eating those exceptions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.