mirror of https://github.com/apache/druid.git
review comments - remove instance of check
This commit is contained in:
parent
af470223f1
commit
05f3f7d49e
|
@ -39,6 +39,8 @@ public interface Cache
|
|||
|
||||
public CacheStats getStats();
|
||||
|
||||
public boolean isLocal();
|
||||
|
||||
public class NamedKey
|
||||
{
|
||||
final public String namespace;
|
||||
|
|
|
@ -149,4 +149,8 @@ public class MapCache implements Cache
|
|||
retVal.rewind();
|
||||
return retVal;
|
||||
}
|
||||
|
||||
public boolean isLocal() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -278,4 +278,8 @@ public class MemcachedCache implements Cache
|
|||
// hash keys to keep things under 250 characters for memcached
|
||||
return memcachedPrefix + ":" + DigestUtils.sha1Hex(key.namespace) + ":" + DigestUtils.sha1Hex(key.key);
|
||||
}
|
||||
|
||||
public boolean isLocal() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -96,16 +96,18 @@ public class CachePopulatingQueryRunnerTest
|
|||
return super.toYielder(
|
||||
initValue,
|
||||
accumulator
|
||||
); //To change body of overridden methods use File | Settings | File Templates.
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
Cache cache = EasyMock.createMock(Cache.class);
|
||||
// cache populater ignores populating for local cache, so a dummy cache
|
||||
EasyMock.expect(cache.isLocal()).andReturn(false);
|
||||
CachePopulatingQueryRunner runner = new CachePopulatingQueryRunner(
|
||||
"segment",
|
||||
new SegmentDescriptor(new Interval("2011/2012"), "version", 0),
|
||||
new DefaultObjectMapper(),
|
||||
// cache populater ignores populating for local cache, so a dummy cache
|
||||
EasyMock.createMock(Cache.class),
|
||||
cache,
|
||||
new TopNQueryQueryToolChest(new TopNQueryConfig()),
|
||||
new QueryRunner()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue