Line data Source code
1 : // Copyright (C) 2014 The Android Open Source Project 2 : // 3 : // Licensed under the Apache License, Version 2.0 (the "License"); 4 : // you may not use this file except in compliance with the License. 5 : // You may obtain a copy of the License at 6 : // 7 : // http://www.apache.org/licenses/LICENSE-2.0 8 : // 9 : // Unless required by applicable law or agreed to in writing, software 10 : // distributed under the License is distributed on an "AS IS" BASIS, 11 : // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 : // See the License for the specific language governing permissions and 13 : // limitations under the License. 14 : 15 : package com.google.gerrit.server.cache; 16 : 17 : public interface PersistentCache { 18 : 19 : DiskStats diskStats(); 20 : 21 : class DiskStats { 22 : private final long size; 23 : private final long space; 24 : private final long hitCount; 25 : private final long missCount; 26 : 27 16 : public DiskStats(long size, long space, long hitCount, long missCount) { 28 16 : this.size = size; 29 16 : this.space = space; 30 16 : this.hitCount = hitCount; 31 16 : this.missCount = missCount; 32 16 : } 33 : 34 : public long size() { 35 15 : return size; 36 : } 37 : 38 : public long space() { 39 16 : return space; 40 : } 41 : 42 : public long hitCount() { 43 16 : return hitCount; 44 : } 45 : 46 : public long requestCount() { 47 16 : return hitCount + missCount; 48 : } 49 : } 50 : }