Top Level Namespace

Instance Method Summary collapse

Instance Method Details

#cassandracmsheapnewsizeinteger

Returns a value (MB) that might be suitable to set the HEAP_NEWSIZE when using the Concurrent Mark Sweep (CMS) Collector. See Tuning Java resources for more details.

Returns:

  • (integer)

    min(100 times the number of cores, 1/4 CMS MAX_HEAP_SIZE)

See Also:



11
12
13
14
15
16
17
18
# File 'lib/facter/cassandracmsheapnewsize.rb', line 11

Facter.add('cassandracmsheapnewsize') do
  setcode do
    maxheapsize = Facter.value(:cassandracmsmaxheapsize).to_f
    processorcount = Facter.value(:processorcount).to_f
    heapnewsize = [100 * processorcount, maxheapsize * 0.25].min
    heapnewsize.round
  end
end

#cassandracmsmaxheapsizeinteger

Returns a value (MB) that might be suitable to set the MAX_HEAP_SIZE when using the Concurrent Mark Sweep (CMS) Collector. See Tuning Java resources for more details.

Returns:

  • (integer)

    max(min(1/2 ram, 1024), min(1/4 ram, 14336))

See Also:



11
12
13
14
15
16
17
18
19
# File 'lib/facter/cassandracmsmaxheapsize.rb', line 11

Facter.add('cassandracmsmaxheapsize') do
  setcode do
    memorysize_mb = Facter.value(:memorysize_mb).to_f
    calc1 = [memorysize_mb * 0.5, 1024].min
    calc2 = [memorysize_mb * 0.25, 14_336].min
    maxheapsize = [calc1, calc2].max
    maxheapsize.round
  end
end

#cassandraheapnewsizeinteger

Returns a value (MB) that might be suitable to set the HEAP_NEWSIZE. See Tuning Java resources for more details.

Returns:

  • (integer)

    min(100 times the number of cores, 1/4 MAX_HEAP_SIZE)

See Also:



10
11
12
13
14
15
16
17
# File 'lib/facter/cassandraheapnewsize.rb', line 10

Facter.add('cassandraheapnewsize') do
  setcode do
    maxheapsize = Facter.value(:cassandramaxheapsize).to_f
    processorcount = Facter.value(:processorcount).to_f
    heapnewsize = [100 * processorcount, maxheapsize * 0.25].min
    heapnewsize.round
  end
end

#cassandramajorversioninteger

Extract the major version from the cassandrarelease fact.

Returns:

  • (integer)

    The major version of the Cassandra instance.

See Also:



6
7
8
9
10
11
# File 'lib/facter/cassandramajorversion.rb', line 6

Facter.add('cassandramajorversion') do
  setcode do
    release = Facter.value(:cassandrarelease)
    release.split('.')[0].to_i if release
  end
end

#cassandramaxheapsizeinteger

Returns a value (MB) that might be suitable to set the MAX_HEAP_SIZE. See Tuning Java resources for more details.

Returns:

  • (integer)

    max(min(1/2 ram, 1024), min(1/4 ram, 8192))

See Also:



10
11
12
13
14
15
16
17
18
# File 'lib/facter/cassandramaxheapsize.rb', line 10

Facter.add('cassandramaxheapsize') do
  setcode do
    memorysize_mb = Facter.value(:memorysize_mb).to_f
    calc1 = [memorysize_mb * 0.5, 1024].min
    calc2 = [memorysize_mb * 0.25, 8192].min
    maxheapsize = [calc1, calc2].max
    maxheapsize.round
  end
end

#cassandraminorversioninteger

Extract the minor version from the cassandrarelease fact.

Returns:

  • (integer)

    The minor version of the Cassandra instance.

See Also:



6
7
8
9
10
11
# File 'lib/facter/cassandraminorversion.rb', line 6

Facter.add('cassandraminorversion') do
  setcode do
    release = Facter.value(:cassandrarelease)
    release.split('.')[1].to_i if release
  end
end

#cassandrapatchversioninteger

Extract the patch version from the cassandrarelease fact.

Returns:

  • (integer)

    The patch version of the Cassandra instance.

See Also:



6
7
8
9
10
11
# File 'lib/facter/cassandrapatchversion.rb', line 6

Facter.add('cassandrapatchversion') do
  setcode do
    release = Facter.value(:cassandrarelease)
    release.split('.')[2].to_i if release
  end
end

#cassandrareleasestring

Extract the release string from the running Cassandra instance.

undefined.

Returns:

  • (string)

    The version string (e.g. 3.0.1).



9
10
11
12
13
14
# File 'lib/facter/cassandrarelease.rb', line 9

Facter.add('cassandrarelease') do
  setcode do
    version = Facter::Util::Resolution.exec('nodetool version')
    version.match(%r{\d+\.\d+\.\d+}).to_s if version && version != ''
  end
end