Changes the size of the increment buffer. NOTE: because there is no way to resize the existing buffer, this method will flush the existing buffer and create a new one. This side effect might be unexpected but is unfortunately required. This determines the maximum number of counters th
(final int increment_buffer_size)
| 925 | * @since 1.3 |
| 926 | */ |
| 927 | public int setIncrementBufferSize(final int increment_buffer_size) { |
| 928 | if (increment_buffer_size < 0) { |
| 929 | throw new IllegalArgumentException("Negative: " + increment_buffer_size); |
| 930 | } |
| 931 | final int current = config.getInt("hbase.increments.buffer_size"); |
| 932 | if (current == increment_buffer_size) { |
| 933 | return current; |
| 934 | } |
| 935 | config.overrideConfig("hbase.increments.buffer_size", |
| 936 | Integer.toString(increment_buffer_size)); |
| 937 | this.increment_buffer_size = increment_buffer_size; |
| 938 | final LoadingCache<BufferedIncrement, BufferedIncrement.Amount> prev = |
| 939 | increment_buffer; // Volatile-read. |
| 940 | if (prev != null) { // Need to resize. |
| 941 | makeIncrementBuffer(); // Volatile-write. |
| 942 | flushBufferedIncrements(prev); |
| 943 | } |
| 944 | return current; |
| 945 | } |
| 946 | |
| 947 | /** |
| 948 | * Returns the timer used by this client. |
nothing calls this directly
no test coverage detected