review comments - remove instance of check

This commit is contained in:
nishantmonu51 2014-03-29 03:06:53 +05:30
parent af470223f1
commit 05f3f7d49e
4 changed files with 15 additions and 3 deletions

View File

@ -39,6 +39,8 @@ public interface Cache
public CacheStats getStats();
public boolean isLocal();
public class NamedKey
{
final public String namespace;

View File

@ -149,4 +149,8 @@ public class MapCache implements Cache
retVal.rewind();
return retVal;
}
public boolean isLocal() {
return true;
}
}

View File

@ -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;
}
}

View File

@ -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()
{