buggy_function stringlengths 1 391k | fixed_function stringlengths 0 392k |
|---|---|
protected byte readByte () throws DRDAProtocolException
{
ensureBLayerDataInBuffer (1, ADJUST_LENGTHS);
return (byte) (buffer[pos++] & 0xff);
}
| protected byte readByte () throws DRDAProtocolException
{
ensureBLayerDataInBuffer (1, ADJUST_LENGTHS);
return buffer[pos++];
}
|
private boolean readBoolean(int codepoint) throws DRDAProtocolException
{
checkLength(codepoint, 1);
int val = reader.readByte();
if (val == CodePoint.TRUE)
return true;
else if (val == CodePoint.FALSE)
return false;
else
invalidValue(codepoint);
return false; //to shut the compiler up
}
| private boolean readBoolean(int codepoint) throws DRDAProtocolException
{
checkLength(codepoint, 1);
byte val = reader.readByte();
if (val == CodePoint.TRUE)
return true;
else if (val == CodePoint.FALSE)
return false;
else
invalidValue(codepoint);
return false; //to shut the compiler up
}
|
public int run(String[] args) throws IOException, ClassNotFoundException, InterruptedException {
addInputOption();
addOutputOption();
addOption("numRecommendations", "n", "Number of recommendations per user",
String.valueOf(AggregateAndRecommendReducer.DEFAULT_NUM_RECOMMENDATIONS));
addOption... | public int run(String[] args) throws IOException, ClassNotFoundException, InterruptedException {
addInputOption();
addOutputOption();
addOption("numRecommendations", "n", "Number of recommendations per user",
String.valueOf(AggregateAndRecommendReducer.DEFAULT_NUM_RECOMMENDATIONS));
addOption... |
public void testFSDirectoryFilter() throws IOException {
checkDirectoryFilter(FSDirectory.open(new File("test")));
}
| public void testFSDirectoryFilter() throws IOException {
checkDirectoryFilter(FSDirectory.open(new File(System.getProperty("tempDir"),"test")));
}
|
private void schedule()
{
requestScheduler.queue(Thread.currentThread(), clientState.getSchedulingId());
}
| private void schedule()
{
requestScheduler.queue(Thread.currentThread(), clientState.getSchedulingValue());
}
|
private void syncRequest(Node node, UpdateRequestExt ureq) {
Request sreq = new Request();
sreq.node = node;
sreq.ureq = ureq;
String url = node.getUrl();
String fullUrl;
if (!url.startsWith("http://") && !url.startsWith("https://")) {
fullUrl = "http://" + url;
} else {
fullU... | private void syncRequest(Node node, UpdateRequestExt ureq) {
Request sreq = new Request();
sreq.node = node;
sreq.ureq = ureq;
String url = node.getUrl();
String fullUrl;
if (!url.startsWith("http://") && !url.startsWith("https://")) {
fullUrl = "http://" + url;
} else {
fullU... |
public String init(NamedList config, SolrCore core) {
LOG.info("init: " + config);
String name = super.init(config, core);
threshold = config.get(THRESHOLD_TOKEN_FREQUENCY) == null ? 0.0f
: (Float) config.get(THRESHOLD_TOKEN_FREQUENCY);
sourceLocation = (String) config.get(LOCATION);
f... | public String init(NamedList config, SolrCore core) {
LOG.info("init: " + config);
String name = super.init(config, core);
threshold = config.get(THRESHOLD_TOKEN_FREQUENCY) == null ? 0.0f
: Float.valueOf((String)config.get(THRESHOLD_TOKEN_FREQUENCY));
sourceLocation = (String) config.get(L... |
public void cacheCurrentTerm(SegmentTermEnum enumerator) {
termsCache.put(new CloneableTerm(enumerator.term()),
new TermInfoAndOrd(enumerator.termInfo,
enumerator.position));
}
TermInfo seekEnum(SegmentTermEnum enumerator, Term term, boolean useCache) ... | public void cacheCurrentTerm(SegmentTermEnum enumerator) {
termsCache.put(new CloneableTerm(enumerator.term()),
new TermInfoAndOrd(enumerator.termInfo,
enumerator.position));
}
TermInfo seekEnum(SegmentTermEnum enumerator, Term term, boolean useCache) ... |
private static final char UNABLE_TO_PROXY = '#';
public static Class<?> getProxySubclass(Class<?> aClass) throws UnableToProxyException
{
LOGGER.debug(AsmInterceptorWrapper.LOG_ENTRY, "getProxySubclass", new Object[] { aClass });
ClassLoader loader = aClass.getClassLoader();
// in the special case w... | private static final char UNABLE_TO_PROXY = '#';
public static Class<?> getProxySubclass(Class<?> aClass) throws UnableToProxyException
{
LOGGER.debug(AsmInterceptorWrapper.LOG_ENTRY, "getProxySubclass", new Object[] { aClass });
ClassLoader loader = aClass.getClassLoader();
// in the special case w... |
public void testSize() {
assertEquals("size", 7, getTestVector().getNumNondefaultElements());
}
| public void testSize() {
assertEquals("size", 3, getTestVector().getNumNondefaultElements());
}
|
private void verifyCachedSchema(Connection c) throws SQLException {
if (c instanceof org.apache.derby.client.am.Connection) {
String cached =
((org.apache.derby.client.am.Connection) c).
getCurrentSchemaName();
Statement s = c.createStatement()... | private void verifyCachedSchema(Connection c) throws SQLException {
if (usingDerbyNetClient()) {
String cached =
((org.apache.derby.client.am.Connection) c).
getCurrentSchemaName();
Statement s = c.createStatement();
ResultSet rs = ... |
public void run() {
try {
TermEnum termEnum = s.getIndexReader().terms(new Term("body", ""));
int seenTermCount = 0;
int shift;
int trigger;
if (totTermCount.get() == 0) {
shift ... | public void run() {
try {
TermEnum termEnum = s.getIndexReader().terms(new Term("body", ""));
int seenTermCount = 0;
int shift;
int trigger;
if (totTermCount.get() == 0) {
shift ... |
public synchronized int numDocs() throws IOException {
int count;
if (docWriter != null)
count = docWriter.getNumDocsInRAM();
else
count = 0;
for (int i = 0; i < segmentInfos.size(); i++) {
final SegmentInfo info = segmentInfos.info(i);
count += info.docCount - info.getDelCoun... | public synchronized int numDocs() throws IOException {
int count;
if (docWriter != null)
count = docWriter.getNumDocsInRAM();
else
count = 0;
for (int i = 0; i < segmentInfos.size(); i++) {
final SegmentInfo info = segmentInfos.info(i);
count += info.docCount - numDeletedDocs(... |
public static Test suite()
{
TestSuite suite = new TestSuite("errorcode Test");
suite.addTest(TestConfiguration.embeddedSuite(ErrorCodeTest.class));
return new LocaleTestSetup(suite, Locale.ENGLISH);
}
| public static Test suite()
{
TestSuite suite = new TestSuite("errorcode Test");
suite.addTest(TestConfiguration.defaultSuite(ErrorCodeTest.class));
return new LocaleTestSetup(suite, Locale.ENGLISH);
}
|
private static List<Row> strongRead(List<ReadCommand> commands) throws IOException, TimeoutException, InvalidRequestException, UnavailableException
{
List<QuorumResponseHandler<Row>> quorumResponseHandlers = new ArrayList<QuorumResponseHandler<Row>>();
List<EndPoint[]> commandEndPoints = new Arr... | private static List<Row> strongRead(List<ReadCommand> commands) throws IOException, TimeoutException, InvalidRequestException, UnavailableException
{
List<QuorumResponseHandler<Row>> quorumResponseHandlers = new ArrayList<QuorumResponseHandler<Row>>();
List<EndPoint[]> commandEndPoints = new Arr... |
private FST<Object> buildAutomaton(BytesRefSorter sorter) throws IOException {
// Build the automaton.
final Outputs<Object> outputs = NoOutputs.getSingleton();
final Object empty = outputs.getNoOutput();
final Builder<Object> builder = new Builder<Object>(
FST.INPUT_TYPE.BYTE1, 0, 0, true, tr... | private FST<Object> buildAutomaton(BytesRefSorter sorter) throws IOException {
// Build the automaton.
final Outputs<Object> outputs = NoOutputs.getSingleton();
final Object empty = outputs.getNoOutput();
final Builder<Object> builder = new Builder<Object>(
FST.INPUT_TYPE.BYTE1, 0, 0, true, tr... |
public int compare(String[] left, String[] right) {
return left[0].compareTo(right[0]);
}
});
System.out.println(" encode...");
PositiveIntOutputs fstOutput = PositiveIntOutputs.getSingleton(true);
Builder<Long> fstBuilder = new Builder<Long>(FST.INPUT_TYPE.BYTE2, 0, 0, true, ... | public int compare(String[] left, String[] right) {
return left[0].compareTo(right[0]);
}
});
System.out.println(" encode...");
PositiveIntOutputs fstOutput = PositiveIntOutputs.getSingleton(true);
Builder<Long> fstBuilder = new Builder<Long>(FST.INPUT_TYPE.BYTE2, 0, 0, true, ... |
public void setExclusionTable( Map<?,?> exclusiontable ) {
exclusions = new HashSet(exclusiontable.keySet());
}
| public void setExclusionTable( Map<?,?> exclusiontable ) {
exclusions = exclusiontable.keySet();
}
|
public boolean validateData(QualityQuery[] qq, PrintWriter logger) {
HashMap<String,QRelJudgement> missingQueries = (HashMap<String, QRelJudgement>) judgements.clone();
ArrayList<String> missingJudgements = new ArrayList<String>();
for (int i=0; i<qq.length; i++) {
String id = qq[i].getQueryID();
... | public boolean validateData(QualityQuery[] qq, PrintWriter logger) {
HashMap<String,QRelJudgement> missingQueries = new HashMap<String, QRelJudgement>(judgements);
ArrayList<String> missingJudgements = new ArrayList<String>();
for (int i=0; i<qq.length; i++) {
String id = qq[i].getQueryID();
i... |
public void testScheduledExecMemoryLeak() throws Exception {
Fixture jar = ArchiveFixture.newJar()
.manifest().symbolicName("test.bundle").end()
.file("OSGI-INF/blueprint/blueprint.xml")
.line("<blueprint xmlns=\"http://www.osgi.org/xmlns/blueprint/v1.0.0\">")
... | public void testScheduledExecMemoryLeak() throws Exception {
Fixture jar = ArchiveFixture.newJar()
.manifest().symbolicName("test.bundle").end()
.file("OSGI-INF/blueprint/blueprint.xml")
.line("<blueprint xmlns=\"http://www.osgi.org/xmlns/blueprint/v1.0.0\">")
... |
String PERSISTENTLY_STARTED = "PersistentlyStarted";
/*
* Copyright (c) OSGi Alliance (2009). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www... | String PERSISTENTLY_STARTED = "PersistentlyStarted";
/*
* Copyright (c) OSGi Alliance (2009). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www... |
private String getRemotCoreUrl(CoreContainer cores, String collectionName, String origCorename) {
ClusterState clusterState = cores.getZkController().getClusterState();
Collection<Slice> slices = clusterState.getActiveSlices(collectionName);
boolean byCoreName = false;
if (slices == null) {
// l... | private String getRemotCoreUrl(CoreContainer cores, String collectionName, String origCorename) {
ClusterState clusterState = cores.getZkController().getClusterState();
Collection<Slice> slices = clusterState.getActiveSlices(collectionName);
boolean byCoreName = false;
if (slices == null) {
// l... |
private SolrZkClient electNewOverseer(String address) throws InterruptedException,
TimeoutException, IOException, KeeperException {
SolrZkClient zkClient = new SolrZkClient(address, TIMEOUT);
ZkStateReader reader = new ZkStateReader(zkClient);
LeaderElector overseerElector = new LeaderElector(zkCli... | private SolrZkClient electNewOverseer(String address) throws InterruptedException,
TimeoutException, IOException, KeeperException {
SolrZkClient zkClient = new SolrZkClient(address, TIMEOUT);
ZkStateReader reader = new ZkStateReader(zkClient);
LeaderElector overseerElector = new LeaderElector(zkCli... |
public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception, ParseException, InstantiationException, IllegalAccessException
{
// int sleep = req.getParams().getInt("sleep",0);
// if (sleep > 0) {log.error("SLEEPING for " + sleep); Thread.sleep(sleep);}
ResponseBuilder rb... | public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception, ParseException, InstantiationException, IllegalAccessException
{
// int sleep = req.getParams().getInt("sleep",0);
// if (sleep > 0) {log.error("SLEEPING for " + sleep); Thread.sleep(sleep);}
ResponseBuilder rb... |
public void testFeature1() throws Exception {
Subsystem subsystem = installSubsystemFromFile("feature1.ssa");
try {
assertSymbolicName("org.apache.aries.subsystem.feature1", subsystem);
assertVersion("1.0.0", subsystem);
assertConstituents(2, subsystem);
// TODO Test internal events for installation.
... | public void testFeature1() throws Exception {
Subsystem subsystem = installSubsystemFromFile("feature1.ssa");
try {
assertSymbolicName("org.apache.aries.subsystem.feature1", subsystem);
assertVersion("1.0.0", subsystem);
assertConstituents(3, subsystem);
// TODO Test internal events for installation.
... |
public static Option[] configuration() {
Option[] options = options(
// Log
mavenBundle("org.ops4j.pax.logging", "pax-logging-api"),
mavenBundle("org.ops4j.pax.logging", "pax-logging-service"),
// Felix Config Admin
mavenBundle("org.apache.felix", "org.apache.felix.configadmin"),
// Felix mvn... | public static Option[] configuration() {
Option[] options = options(
// Log
mavenBundle("org.ops4j.pax.logging", "pax-logging-api"),
mavenBundle("org.ops4j.pax.logging", "pax-logging-service"),
// Felix Config Admin
mavenBundle("org.apache.felix", "org.apache.felix.configadmin"),
// Felix mvn... |
public static DeploymentManifest newInstance(SubsystemManifest manifest, SubsystemEnvironment environment) {
DeploymentManifest result = new DeploymentManifest();
result.headers.put(ManifestVersionHeader.NAME, manifest.getManifestVersion());
Collection<Requirement> requirements = new ArrayList<Requirement>();
... | public static DeploymentManifest newInstance(SubsystemManifest manifest, SubsystemEnvironment environment) {
DeploymentManifest result = new DeploymentManifest();
result.headers.put(ManifestVersionHeader.NAME, manifest.getManifestVersion());
Collection<Requirement> requirements = new ArrayList<Requirement>();
... |
public void renameCf() throws ConfigurationException, IOException, ExecutionException, InterruptedException
{
DecoratedKey dk = Util.dk("key0");
final KSMetaData ks = DatabaseDescriptor.getTableDefinition("Keyspace2");
assert ks != null;
final CFMetaData oldCfm = ks.cfMetaData().... | public void renameCf() throws ConfigurationException, IOException, ExecutionException, InterruptedException
{
DecoratedKey dk = Util.dk("key0");
final KSMetaData ks = DatabaseDescriptor.getTableDefinition("Keyspace2");
assert ks != null;
final CFMetaData oldCfm = ks.cfMetaData().... |
public static ColumnFamily getDroppedCFs() throws IOException
{
ColumnFamilyStore cfs = Table.open(Table.SYSTEM_TABLE).getColumnFamilyStore(SystemTable.STATUS_CF);
return cfs.getColumnFamily(QueryFilter.getSliceFilter(decorate(GRAVEYARD_KEY), new QueryPath(STATUS_CF), "".getBytes(), "".getBytes(... | public static ColumnFamily getDroppedCFs() throws IOException
{
ColumnFamilyStore cfs = Table.open(Table.SYSTEM_TABLE).getColumnFamilyStore(SystemTable.STATUS_CF);
return cfs.getColumnFamily(QueryFilter.getSliceFilter(decorate(GRAVEYARD_KEY), new QueryPath(STATUS_CF), "".getBytes(), "".getBytes(... |
public static Collection<IColumn> getLocalMigrations(UUID start, UUID end)
{
DecoratedKey dkey = StorageService.getPartitioner().decorateKey(MIGRATIONS_KEY);
Table defs = Table.open(Table.SYSTEM_TABLE);
ColumnFamilyStore cfStore = defs.getColumnFamilyStore(Migration.MIGRATIONS_CF);
... | public static Collection<IColumn> getLocalMigrations(UUID start, UUID end)
{
DecoratedKey dkey = StorageService.getPartitioner().decorateKey(MIGRATIONS_KEY);
Table defs = Table.open(Table.SYSTEM_TABLE);
ColumnFamilyStore cfStore = defs.getColumnFamilyStore(Migration.MIGRATIONS_CF);
... |
public SnowballFilter(TokenStream in, String name) {
super(in);
try {
Class<? extends SnowballProgram> stemClass =
Class.forName("org.tartarus.snowball.ext." + name + "Stemmer").asSubclass(SnowballProgram.class);
stemmer = stemClass.newInstance();
} catch (Exception e) {
th... | public SnowballFilter(TokenStream in, String name) {
super(in);
try {
Class<? extends SnowballProgram> stemClass =
Class.forName("org.tartarus.snowball.ext." + name + "Stemmer").asSubclass(SnowballProgram.class);
stemmer = stemClass.newInstance();
} catch (Exception e) {
th... |
protected void copyState(SQLChar other) {
this.value = other.value;
this.rawData = other.rawData;
this.rawLength = other.rawLength;
this.cKey = other.cKey;
this.stream = other.stream;
this._clobValue = other._clobValue;
this.localeFinder = localeFinder;
}... | protected void copyState(SQLChar other) {
this.value = other.value;
this.rawData = other.rawData;
this.rawLength = other.rawLength;
this.cKey = other.cKey;
this.stream = other.stream;
this._clobValue = other._clobValue;
this.localeFinder = other.localeFinder;... |
public NamedSPILoader(Class<S> clazz) {
this(clazz, Thread.currentThread().getContextClassLoader());
}
public NamedSPILoader(Class<S> clazz, ClassLoader classloader) {
this.clazz = clazz;
reload(classloader);
}
/**
* Reloads the internal SPI list from the given {@link ClassLoader}.
* ... | public NamedSPILoader(Class<S> clazz) {
this(clazz, Thread.currentThread().getContextClassLoader());
}
public NamedSPILoader(Class<S> clazz, ClassLoader classloader) {
this.clazz = clazz;
reload(classloader);
}
/**
* Reloads the internal SPI list from the given {@link ClassLoader}.
* ... |
private void doTest(final SpatialOperation operation) throws IOException {
//first show that when there's no data, a query will result in no results
{
Query query = strategy.makeQuery(new SpatialArgs(operation, randomRectangle()));
SearchResults searchResults = executeQuery(query, 1);
assert... | private void doTest(final SpatialOperation operation) throws IOException {
//first show that when there's no data, a query will result in no results
{
Query query = strategy.makeQuery(new SpatialArgs(operation, randomRectangle()));
SearchResults searchResults = executeQuery(query, 1);
assert... |
public synchronized final long getRecomputedSizeInBytes() {
long size = 0;
Iterator it = fileMap.values().iterator();
while (it.hasNext())
size += ((RAMFile) it.next()).getSizeInBytes();
return size;
}
/** Like getRecomputedSizeInBytes(), but, uses actual file
* lengths rather than buffe... | public synchronized final long getRecomputedSizeInBytes() {
long size = 0;
Iterator it = fileMap.values().iterator();
while (it.hasNext())
size += ((RAMFile) it.next()).getSizeInBytes();
return size;
}
/** Like getRecomputedSizeInBytes(), but, uses actual file
* lengths rather than buffe... |
public static SegmentInfo writeDoc(Directory dir, Analyzer analyzer, Similarity similarity, Document doc) throws IOException
{
IndexWriter writer = new IndexWriter(dir, analyzer);
writer.setSimilarity(similarity);
//writer.setUseCompoundFile(false);
writer.addDocument(doc);
writer.flush();
S... | public static SegmentInfo writeDoc(Directory dir, Analyzer analyzer, Similarity similarity, Document doc) throws IOException
{
IndexWriter writer = new IndexWriter(dir, analyzer);
writer.setSimilarity(similarity);
//writer.setUseCompoundFile(false);
writer.addDocument(doc);
writer.flush();
S... |
private SegmentInfo indexDoc(IndexWriter writer, String fileName)
throws Exception
{
File file = new File(workDir, fileName);
Document doc = FileDocument.Document(file);
writer.addDocument(doc);
writer.flush();
return writer.segmentInfos.info(writer.segmentInfos.size()-1);
}
| private SegmentInfo indexDoc(IndexWriter writer, String fileName)
throws Exception
{
File file = new File(workDir, fileName);
Document doc = FileDocument.Document(file);
writer.addDocument(doc);
writer.flush();
return writer.newestSegment();
}
|
public DecoratedKey getKey()
{
return filter.key;
}
};
ColumnFamily returnCF = container.cloneMeShallow();
filter.collateColumns(returnCF, Collections.singletonList(toCollate), cfs.metadata.comparator, gcBefore);
... | public DecoratedKey getKey()
{
return filter.key;
}
};
ColumnFamily returnCF = container.cloneMeShallow();
filter.collateColumns(returnCF, Collections.singletonList(toCollate), cfs.metadata.comparator, gcBefore);
... |
public void testInvalidLDAPServerConnectionError() throws SQLException {
// setup
Connection conn = getConnection();
// set the ldap properties
setDatabaseProperty("derby.connection.requireAuthentication", "true", conn);
setDatabaseProperty("derby.authentication.provider", "... | public void testInvalidLDAPServerConnectionError() throws SQLException {
// setup
Connection conn = getConnection();
// set the ldap properties
setDatabaseProperty("derby.connection.requireAuthentication", "true", conn);
setDatabaseProperty("derby.authentication.provider", "... |
public List<ColumnOrSuperColumn> get_slice(String keyspace, String key, ColumnParent column_parent, SlicePredicate predicate, int consistency_level)
throws InvalidRequestException, NotFoundException
{
if (logger.isDebugEnabled())
logger.debug("get_slice_from");
ThriftValidation.v... | public List<ColumnOrSuperColumn> get_slice(String keyspace, String key, ColumnParent column_parent, SlicePredicate predicate, int consistency_level)
throws InvalidRequestException, NotFoundException
{
if (logger.isDebugEnabled())
logger.debug("get_slice_from");
ThriftValidation.v... |
private void doTestExactScore(String field, boolean inOrder) throws Exception {
IndexReader r = DirectoryReader.open(dir);
IndexSearcher s = new IndexSearcher(r);
ValueSource vs;
if (inOrder) {
vs = new OrdFieldSource(field);
} else {
vs = new ReverseOrdFieldSource(field);
}
Qu... | private void doTestExactScore(String field, boolean inOrder) throws Exception {
IndexReader r = DirectoryReader.open(dir);
IndexSearcher s = new IndexSearcher(r);
ValueSource vs;
if (inOrder) {
vs = new OrdFieldSource(field);
} else {
vs = new ReverseOrdFieldSource(field);
}
Qu... |
public int intVal(int doc) {
return (end - sindex.getOrd(doc+off));
}
};
}
| public int intVal(int doc) {
return (end - sindex.getOrd(doc+off) - 1);
}
};
}
|
public void testBackCompatXml() throws Exception {
setMeUp();
addSolrPropertiesFile();
addSolrXml();
addConfigsForBackCompat();
CoreContainer cc = init();
try {
Properties props = cc.getContainerProperties();
assertEquals("/admin/cores", cc.getAdminPath());
assertEquals("co... | public void testBackCompatXml() throws Exception {
setMeUp();
addSolrPropertiesFile();
addSolrXml();
addConfigsForBackCompat();
CoreContainer cc = init();
try {
Properties props = cc.getContainerProperties();
assertEquals("/admin/cores", cc.getAdminPath());
assertEquals("co... |
protected AbstractCompactedRow getReduced()
{
assert rows.size() > 0;
try
{
AbstractCompactedRow compactedRow = controller.getCompactedRow(rows);
if (compactedRow.isEmpty())
{
controller.invalidateCachedRow(compactedRow.key);
... | protected AbstractCompactedRow getReduced()
{
assert rows.size() > 0;
try
{
AbstractCompactedRow compactedRow = controller.getCompactedRow(new ArrayList<SSTableIdentityIterator>(rows));
if (compactedRow.isEmpty())
{
controller.invalida... |
protected IColumn getReduced()
{
assert container != null;
IColumn reduced = container.iterator().next();
ColumnFamily purged = shouldPurge ? ColumnFamilyStore.removeDeleted(container, controller.gcBefore) : container;
if (purged != null && purged.metadata... | protected IColumn getReduced()
{
assert container != null;
IColumn reduced = container.iterator().next();
ColumnFamily purged = shouldPurge ? ColumnFamilyStore.removeDeleted(container, controller.gcBefore) : container;
if (shouldPurge && purged != null && ... |
final private int mergeMiddle(MergePolicy.OneMerge merge)
throws CorruptIndexException, IOException {
merge.checkAborted(directory);
final String mergedName = merge.info.name;
int mergedDocCount = 0;
SegmentInfos sourceSegments = merge.segments;
SegmentMerger merger = new Segment... | final private int mergeMiddle(MergePolicy.OneMerge merge)
throws CorruptIndexException, IOException {
merge.checkAborted(directory);
final String mergedName = merge.info.name;
int mergedDocCount = 0;
SegmentInfos sourceSegments = merge.segments;
SegmentMerger merger = new Segment... |
public void testTrecFeedDirAllTypes() throws Exception {
File dataDir = _TestUtil.getTempDir("trecFeedAllTypes");
_TestUtil.unzip(getDataFile("trecdocs.zip"), dataDir);
TrecContentSource tcs = new TrecContentSource();
Properties props = new Properties();
props.setProperty("print.props", "false");... | public void testTrecFeedDirAllTypes() throws Exception {
File dataDir = _TestUtil.getTempDir("trecFeedAllTypes");
_TestUtil.unzip(getDataFile("trecdocs.zip"), dataDir);
TrecContentSource tcs = new TrecContentSource();
Properties props = new Properties();
props.setProperty("print.props", "false");... |
public void testBasicUsage() throws Exception {
checkCorrectClassification(new KNearestNeighborClassifier(1), new BytesRef("technology"), new MockAnalyzer(random()), categoryFieldName);
}
| public void testBasicUsage() throws Exception {
checkCorrectClassification(new KNearestNeighborClassifier(1), TECHNOLOGY_INPUT, TECHNOLOGY_RESULT, new MockAnalyzer(random()), categoryFieldName);
}
|
public ClassificationResult<BytesRef> assignClass(String inputDocument) throws IOException {
if (atomicReader == null) {
throw new IOException("You must first call Classifier#train first");
}
double max = 0d;
BytesRef foundClass = new BytesRef();
Terms terms = MultiFields.getTerms(atomicRea... | public ClassificationResult<BytesRef> assignClass(String inputDocument) throws IOException {
if (atomicReader == null) {
throw new IOException("You must first call Classifier#train first");
}
double max = 0d;
BytesRef foundClass = new BytesRef();
Terms terms = MultiFields.getTerms(atomicRea... |
private void verifyStatistics()
throws SQLException {
// DERBY-5097: On machines with a single core/CPU the load generated
// by the test threads may cause the index statistics daemon worker
// thread to be "starved". Add a timeout to give it a chance to do
// what it has... | private void verifyStatistics()
throws SQLException {
// DERBY-5097: On machines with a single core/CPU the load generated
// by the test threads may cause the index statistics daemon worker
// thread to be "starved". Add a timeout to give it a chance to do
// what it has... |
public Query parse() throws ParseException {
SolrParams localParams = getLocalParams();
SolrParams params = getParams();
solrParams = SolrParams.wrapDefaults(localParams, params);
userFields = new UserFields(U.parseFieldBoosts(solrParams.getParams(DMP.UF)));
queryFields = SolrPluginUtil... | public Query parse() throws ParseException {
SolrParams localParams = getLocalParams();
SolrParams params = getParams();
solrParams = SolrParams.wrapDefaults(localParams, params);
userFields = new UserFields(U.parseFieldBoosts(solrParams.getParams(DMP.UF)));
queryFields = SolrPluginUtil... |
public final boolean isProxy(Object proxy)
{
return (getInvocationHandler(proxy) instanceof ProxyHandler);
}
| public final boolean isProxy(Object proxy)
{
return (proxy != null && getInvocationHandler(proxy) instanceof ProxyHandler);
}
|
private final CSVLoader.FieldAdder base;
FieldSplitter(CSVStrategy strategy, CSVLoader.FieldAdder base) {
this.strategy = strategy;
this.base = base;
}
void add(SolrInputDocument doc, int line, int column, String val) {
CSVParser parser = new CSVParser(new StringReader(val), strategy)... | private final CSVLoader.FieldAdder base;
FieldSplitter(CSVStrategy strategy, CSVLoader.FieldAdder base) {
this.strategy = strategy;
this.base = base;
}
void add(SolrInputDocument doc, int line, int column, String val) {
CSVParser parser = new CSVParser(new StringReader(val), strategy)... |
protected SolrServer createNewSolrServer()
{
try {
// setup the server...
String url = "http://localhost:"+port+context;
CommonsHttpSolrServer s = new CommonsHttpSolrServer( url );
s.setConnectionTimeout(5);
s.setDefaultMaxConnectionsPerHost(100);
s.setMaxTotalConnections(100... | protected SolrServer createNewSolrServer()
{
try {
// setup the server...
String url = "http://localhost:"+port+context;
CommonsHttpSolrServer s = new CommonsHttpSolrServer( url );
s.setConnectionTimeout(100); // 1/10th sec
s.setDefaultMaxConnectionsPerHost(100);
s.setMaxTota... |
public HMMChineseTokenizer(AttributeFactory factory) {
super((BreakIterator)sentenceProto.clone());
}
| public HMMChineseTokenizer(AttributeFactory factory) {
super(factory, (BreakIterator)sentenceProto.clone());
}
|
public ThaiTokenizer(AttributeFactory factory) {
super((BreakIterator)sentenceProto.clone());
if (!DBBI_AVAILABLE) {
throw new UnsupportedOperationException("This JRE does not have support for Thai segmentation");
}
wordBreaker = (BreakIterator)proto.clone();
}
| public ThaiTokenizer(AttributeFactory factory) {
super(factory, (BreakIterator)sentenceProto.clone());
if (!DBBI_AVAILABLE) {
throw new UnsupportedOperationException("This JRE does not have support for Thai segmentation");
}
wordBreaker = (BreakIterator)proto.clone();
}
|
public static synchronized Collection<KSMetaData> loadFromStorage(UUID version) throws IOException
{
DecoratedKey vkey = StorageService.getPartitioner().decorateKey(Migration.toUTF8Bytes(version));
Table defs = Table.open(Table.SYSTEM_TABLE);
ColumnFamilyStore cfStore = defs.getColumnFam... | public static synchronized Collection<KSMetaData> loadFromStorage(UUID version) throws IOException
{
DecoratedKey vkey = StorageService.getPartitioner().decorateKey(Migration.toUTF8Bytes(version));
Table defs = Table.open(Table.SYSTEM_TABLE);
ColumnFamilyStore cfStore = defs.getColumnFam... |
public static Migration deserialize(byte[] bytes) throws IOException
{
// deserialize
org.apache.cassandra.db.migration.avro.Migration mi = SerDeUtils.deserializeWithSchema(bytes);
// create an instance of the migration subclass
Migration migration;
try
{
... | public static Migration deserialize(byte[] bytes) throws IOException
{
// deserialize
org.apache.cassandra.db.migration.avro.Migration mi = SerDeUtils.deserializeWithSchema(bytes, new org.apache.cassandra.db.migration.avro.Migration());
// create an instance of the migration subclass
... |
public void connect() {
if (zkController != null) return;
synchronized(this) {
if (zkController != null) return;
try {
ZkController zk = new ZkController(zkHost, zkConnectTimeout, zkClientTimeout, null, null, null);
zk.addShardZkNodeWatches();
zk.updateCloudState(true);
... | public void connect() {
if (zkController != null) return;
synchronized(this) {
if (zkController != null) return;
try {
ZkController zk = new ZkController(zkHost, zkConnectTimeout, zkClientTimeout, null, null, null);
zk.addShardZkNodeWatches();
zk.getZkStateReader().updateCl... |
public void afterExecute(Runnable r, Throwable t)
{
super.afterExecute(r,t);
// exceptions wrapped by FutureTask
if (r instanceof FutureTask)
{
try
{
((FutureTask) r).get();
}
catch (InterruptedException e)
... | public void afterExecute(Runnable r, Throwable t)
{
super.afterExecute(r,t);
// exceptions wrapped by FutureTask
if (r instanceof FutureTask)
{
try
{
((FutureTask) r).get();
}
catch (InterruptedException e)
... |
private RefCount getRefCount(String fileName) {
RefCount rc;
if (!refCounts.containsKey(fileName)) {
rc = new RefCount(fileName);
refCounts.put(fileName, rc);
} else {
rc = refCounts.get(fileName);
}
return rc;
}
void deleteFiles(List<String> files) throws IOException {
... | private RefCount getRefCount(String fileName) {
RefCount rc;
if (!refCounts.containsKey(fileName)) {
rc = new RefCount(fileName);
refCounts.put(fileName, rc);
} else {
rc = refCounts.get(fileName);
}
return rc;
}
void deleteFiles(List<String> files) throws IOException {
... |
public void _testStressLocks(LockFactory lockFactory, String indexDirName) throws IOException {
FSDirectory fs1 = FSDirectory.getDirectory(indexDirName, lockFactory);
// First create a 1 doc index:
IndexWriter w = new IndexWriter(fs1, new WhitespaceAnalyzer(), true);
addDoc(w);
... | public void _testStressLocks(LockFactory lockFactory, String indexDirName) throws IOException {
FSDirectory fs1 = FSDirectory.getDirectory(indexDirName, lockFactory, false);
// First create a 1 doc index:
IndexWriter w = new IndexWriter(fs1, new WhitespaceAnalyzer(), true);
addDoc(w... |
private void testIndexInternal(int maxWait) throws IOException {
final boolean create = true;
//Directory rd = new RAMDirectory();
// work on disk to make sure potential lock problems are tested:
String tempDir = System.getProperty("java.io.tmpdir");
if (tempDir == null)
throw new IOExceptio... | private void testIndexInternal(int maxWait) throws IOException {
final boolean create = true;
//Directory rd = new RAMDirectory();
// work on disk to make sure potential lock problems are tested:
String tempDir = System.getProperty("java.io.tmpdir");
if (tempDir == null)
throw new IOExceptio... |
public void testThreadedOptimize() throws Exception {
Directory directory = new MockRAMDirectory();
runTest(directory, false, null);
runTest(directory, true, null);
runTest(directory, false, new ConcurrentMergeScheduler());
runTest(directory, true, new ConcurrentMergeScheduler());
directory.cl... | public void testThreadedOptimize() throws Exception {
Directory directory = new MockRAMDirectory();
runTest(directory, false, null);
runTest(directory, true, null);
runTest(directory, false, new ConcurrentMergeScheduler());
runTest(directory, true, new ConcurrentMergeScheduler());
directory.cl... |
public void testAtomicUpdates() throws Exception {
Directory directory;
// First in a RAM directory:
directory = new MockRAMDirectory();
runTest(directory);
directory.close();
// Second in an FSDirectory:
String tempDir = System.getProperty("java.io.tmpdir");
File dirPath = new File... | public void testAtomicUpdates() throws Exception {
Directory directory;
// First in a RAM directory:
directory = new MockRAMDirectory();
runTest(directory);
directory.close();
// Second in an FSDirectory:
String tempDir = System.getProperty("java.io.tmpdir");
File dirPath = new File... |
public void setUp() throws Exception {
super.setUp();
File file = new File(System.getProperty("tempDir"), "testIndex");
_TestUtil.rmDir(file);
dir = FSDirectory.getDirectory(file);
}
| public void setUp() throws Exception {
super.setUp();
File file = new File(System.getProperty("tempDir"), "testIndex");
_TestUtil.rmDir(file);
dir = FSDirectory.getDirectory(file, null, false);
}
|
public IndexableField createField(SchemaField field, Object val, float boost) {
if (val == null) return null;
if (!field.stored()) {
log.trace("Ignoring unstored binary field: " + field);
return null;
}
byte[] buf = null;
int offset = 0, len = 0;
if (val instanceof byte[]) {
... | public IndexableField createField(SchemaField field, Object val, float boost) {
if (val == null) return null;
if (!field.stored()) {
log.trace("Ignoring unstored binary field: " + field);
return null;
}
byte[] buf = null;
int offset = 0, len = 0;
if (val instanceof byte[]) {
... |
public static void beforeClass() throws Exception {
NUM_DOCS = atLeast(500);
NUM_ORDS = atLeast(2);
directory = newDirectory();
RandomIndexWriter writer= new RandomIndexWriter(random, directory, newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random)).setMergePolicy(newLogMergePolicy()));
... | public static void beforeClass() throws Exception {
NUM_DOCS = atLeast(500);
NUM_ORDS = atLeast(2);
directory = newDirectory();
RandomIndexWriter writer= new RandomIndexWriter(random, directory, newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random)).setMergePolicy(newLogMergePolicy()));
... |
public void testMultiValuedNRQ() throws Exception {
Directory directory = newDirectory();
RandomIndexWriter writer = new RandomIndexWriter(random, directory,
newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random))
.setMaxBufferedDocs(_TestUtil.nextInt(random, 50, 1000)));
... | public void testMultiValuedNRQ() throws Exception {
Directory directory = newDirectory();
RandomIndexWriter writer = new RandomIndexWriter(random, directory,
newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random))
.setMaxBufferedDocs(_TestUtil.nextInt(random, 50, 1000)));
... |
private void addDoc(RandomIndexWriter w, Collection<String> terms, Map<BytesRef,Integer> termToID, int id) throws IOException {
Document doc = new Document();
doc.add(new NumericField("id").setIntValue(id));
if (VERBOSE) {
System.out.println("TEST: addDoc id:" + id + " terms=" + terms);
}
fo... | private void addDoc(RandomIndexWriter w, Collection<String> terms, Map<BytesRef,Integer> termToID, int id) throws IOException {
Document doc = new Document();
doc.add(new NumericField("id", id));
if (VERBOSE) {
System.out.println("TEST: addDoc id:" + id + " terms=" + terms);
}
for (String s2... |
public Query rewrite(IndexReader reader) throws IOException {
if (clauses.size() == 1) { // optimize 1-clause queries
BooleanClause c = (BooleanClause)clauses.elementAt(0);
if (!c.prohibited) { // just return clause
Query query = c.query;
if (getBoost() != 1.0f) ... | public Query rewrite(IndexReader reader) throws IOException {
if (clauses.size() == 1) { // optimize 1-clause queries
BooleanClause c = (BooleanClause)clauses.elementAt(0);
if (!c.prohibited) { // just return clause
Query query = c.query.rewrite(reader); // rewrite fi... |
public static void removePersistentService(String name)
throws StandardException
{
// For now we only allow dropping in-memory databases.
// This is mostly due to the fact that the current implementation for
// the on-disk back end doesn't handle logDevice when dropping.
... | public static void removePersistentService(String name)
throws StandardException
{
// For now we only allow dropping in-memory databases.
// This is mostly due to the fact that the current implementation for
// the on-disk back end doesn't handle logDevice when dropping.
... |
public void normalTest1(String query, int[] expdnrs) throws Exception {
BooleanQueryTest bqt = new BooleanQueryTest( query, expdnrs, db1, fieldName, this,
new BasicQueryFactory(maxBasicQueries));
bqt.setVerbose(verbose);
bqt.doTest();
}
| public void normalTest1(String query, int[] expdnrs) throws Exception {
BooleanQueryTst bqt = new BooleanQueryTst( query, expdnrs, db1, fieldName, this,
new BasicQueryFactory(maxBasicQueries));
bqt.setVerbose(verbose);
bqt.doTest();
}
|
public void test01Exceptions() throws Exception {
String m = ExceptionQueryTest.getFailQueries(exceptionQueries, verbose);
if (m.length() > 0) {
fail("No ParseException for:\n" + m);
}
}
| public void test01Exceptions() throws Exception {
String m = ExceptionQueryTst.getFailQueries(exceptionQueries, verbose);
if (m.length() > 0) {
fail("No ParseException for:\n" + m);
}
}
|
protected Query newFieldQuery(Analyzer analyzer, String field, String queryText, boolean quoted) throws SyntaxError {
// Use the analyzer to get all the tokens, and then build a TermQuery,
// PhraseQuery, or nothing based on the term count
TokenStream source;
try {
source = analyzer.tokenStrea... | protected Query newFieldQuery(Analyzer analyzer, String field, String queryText, boolean quoted) throws SyntaxError {
// Use the analyzer to get all the tokens, and then build a TermQuery,
// PhraseQuery, or nothing based on the term count
TokenStream source;
try {
source = analyzer.tokenStrea... |
public void testLUCENE_3042() throws Exception {
String testString = "t";
Analyzer analyzer = new MockAnalyzer(random());
TokenStream stream = analyzer.tokenStream("dummy", new StringReader(testString));
stream.reset();
while (stream.incrementToken()) {
// consume
}
stream.end()... | public void testLUCENE_3042() throws Exception {
String testString = "t";
Analyzer analyzer = new MockAnalyzer(random());
TokenStream stream = analyzer.tokenStream("dummy", testString);
stream.reset();
while (stream.incrementToken()) {
// consume
}
stream.end();
stream.close... |
public void testRandomPhrases() throws Exception {
Directory dir = newDirectory();
Analyzer analyzer = new MockAnalyzer(random());
RandomIndexWriter w = new RandomIndexWriter(random(), dir, newIndexWriterConfig(TEST_VERSION_CURRENT, analyzer).setMergePolicy(newLogMergePolicy()));
List<List<String>> ... | public void testRandomPhrases() throws Exception {
Directory dir = newDirectory();
Analyzer analyzer = new MockAnalyzer(random());
RandomIndexWriter w = new RandomIndexWriter(random(), dir, newIndexWriterConfig(TEST_VERSION_CURRENT, analyzer).setMergePolicy(newLogMergePolicy()));
List<List<String>> ... |
public void testEndOffsetPositionWithTeeSinkTokenFilter() throws Exception {
Directory dir = newDirectory();
Analyzer analyzer = new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false);
IndexWriter w = new IndexWriter(dir, newIndexWriterConfig(TEST_VERSION_CURRENT, analyzer));
Document doc = new D... | public void testEndOffsetPositionWithTeeSinkTokenFilter() throws Exception {
Directory dir = newDirectory();
Analyzer analyzer = new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false);
IndexWriter w = new IndexWriter(dir, newIndexWriterConfig(TEST_VERSION_CURRENT, analyzer));
Document doc = new D... |
public void testTokenAttributes() throws Exception {
TokenStream ts = a.tokenStream("dummy", new StringReader("This is a test"));
ScriptAttribute scriptAtt = ts.addAttribute(ScriptAttribute.class);
ts.reset();
while (ts.incrementToken()) {
assertEquals(UScript.LATIN, scriptAtt.getCode());
... | public void testTokenAttributes() throws Exception {
TokenStream ts = a.tokenStream("dummy", "This is a test");
ScriptAttribute scriptAtt = ts.addAttribute(ScriptAttribute.class);
ts.reset();
while (ts.incrementToken()) {
assertEquals(UScript.LATIN, scriptAtt.getCode());
assertEquals(UScri... |
public int read(byte[] b, int off, int len) throws IOException {
int actualLength = 0;
updateIfRequired();
//If maxPos is not invalid then
//ensure that the length(len)
//that is requested falls within
//the restriction set by maxPos.
if(maxPos != -1... | public int read(byte[] b, int off, int len) throws IOException {
int actualLength = 0;
updateIfRequired();
//If maxPos is not invalid then
//ensure that the length(len)
//that is requested falls within
//the restriction set by maxPos.
if(maxPos != -1... |
public void apply(org.apache.cassandra.db.migration.avro.CfDef cf_def) throws ConfigurationException
{
// validate
if (!cf_def.keyspace.toString().equals(ksName))
throw new ConfigurationException(String.format("Keyspace mismatch (found %s; expected %s)",
... | public void apply(org.apache.cassandra.db.migration.avro.CfDef cf_def) throws ConfigurationException
{
// validate
if (!cf_def.keyspace.toString().equals(ksName))
throw new ConfigurationException(String.format("Keyspace mismatch (found %s; expected %s)",
... |
public SegmentInfoWriter getSegmentInfosWriter() {
return writer;
}
} | public SegmentInfoWriter getSegmentInfoWriter() {
return writer;
}
} |
public final void read(Directory directory, String segmentFileName) throws CorruptIndexException, IOException {
boolean success = false;
// Clear any previous segments:
this.clear();
generation = generationFromSegmentsFileName(segmentFileName);
lastGeneration = generation;
ChecksumIndexInp... | public final void read(Directory directory, String segmentFileName) throws CorruptIndexException, IOException {
boolean success = false;
// Clear any previous segments:
this.clear();
generation = generationFromSegmentsFileName(segmentFileName);
lastGeneration = generation;
ChecksumIndexInp... |
private void go()
throws Exception
{
try
{
// Connect to the database, prepare statements,
// and load id-to-name mappings.
this.conn = DriverManager.getConnection(sourceDBUrl);
prepForDump();
boolean at10_6 = atVersion( conn, 10, 6 );
// Generate DDL.
// Start with schemas, si... | private void go()
throws Exception
{
try
{
// Connect to the database, prepare statements,
// and load id-to-name mappings.
this.conn = DriverManager.getConnection(sourceDBUrl);
prepForDump();
boolean at10_6 = atVersion( conn, 10, 6 );
// Generate DDL.
// Start with schemas, si... |
public static long absoluteFromFraction(double fractOrAbs, long total)
{
if (fractOrAbs < 0)
throw new UnsupportedOperationException("unexpected negative value " + fractOrAbs);
if (0 < fractOrAbs && fractOrAbs < 1)
{
// fraction
return Math.max(1, (lo... | public static long absoluteFromFraction(double fractOrAbs, long total)
{
if (fractOrAbs < 0)
throw new UnsupportedOperationException("unexpected negative value " + fractOrAbs);
if (0 < fractOrAbs && fractOrAbs <= 1)
{
// fraction
return Math.max(1, (l... |
public void init(NamedList args) {
super.init(args);
SolrParams p = SolrParams.toSolrParams(args);
restrictToField = p.get("termSourceField");
spellcheckerIndexDir = p.get("spellcheckerIndexDir");
try {
spellChecker = new SpellChecker(FSDirectory.getDirectory(spel... | public void init(NamedList args) {
super.init(args);
SolrParams p = SolrParams.toSolrParams(args);
termSourceField = p.get("termSourceField");
spellcheckerIndexDir = p.get("spellcheckerIndexDir");
try {
spellChecker = new SpellChecker(FSDirectory.getDirectory(spel... |
public void BlueprintSample() throws Exception {
System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Start Test Blueprint Sample");
//////////////////////////////
//Test BlueprintStateMBean
//////////////////////////////
//find the Blueprint Sample bundle i... | public void BlueprintSample() throws Exception {
System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Start Test Blueprint Sample");
//////////////////////////////
//Test BlueprintStateMBean
//////////////////////////////
//find the Blueprint Sample bundle i... |
public CompositeData installBundles(String[] locations, String[] urls) throws IOException {
if(locations == null || urls == null){
return new BatchInstallResult("Failed to install bundles arguments can't be null").toCompositeData();
}
if(locations != null && locations !... | public CompositeData installBundles(String[] locations, String[] urls) throws IOException {
if(locations == null || urls == null){
return new BatchInstallResult("Failed to install bundles arguments can't be null").toCompositeData();
}
if(locations != null && locations.l... |
protected int readXaPrepare(NetConnection conn) throws DisconnectException {
startSameIdChainParse();
int synctype = parseSYNCCTLreply(conn);
endOfSameIdChainData();
NetXACallInfo callInfo = conn.xares_.callInfoArray_[conn.currXACallInfoOffset_];
if (synctype == NetXAResourc... | protected int readXaPrepare(NetConnection conn) throws DisconnectException {
startSameIdChainParse();
int synctype = parseSYNCCTLreply(conn);
endOfSameIdChainData();
NetXACallInfo callInfo = conn.xares_.callInfoArray_[conn.currXACallInfoOffset_];
if (synctype == XAResource.X... |
private void checkInvariants(IndexWriter writer) throws IOException {
_TestUtil.syncConcurrentMerges(writer);
int maxBufferedDocs = writer.getMaxBufferedDocs();
int mergeFactor = writer.getMergeFactor();
int maxMergeDocs = writer.getMaxMergeDocs();
int ramSegmentCount = writer.getNumBufferedDocum... | private void checkInvariants(IndexWriter writer) throws IOException {
_TestUtil.syncConcurrentMerges(writer);
int maxBufferedDocs = writer.getMaxBufferedDocs();
int mergeFactor = writer.getMergeFactor();
int maxMergeDocs = writer.getMaxMergeDocs();
int ramSegmentCount = writer.getNumBufferedDocum... |
public long sizeInBytes() {
return file.numBuffers() * BUFFER_SIZE;
}
| public long sizeInBytes() {
return (long) file.numBuffers() * (long) BUFFER_SIZE;
}
|
private void verifyInterval(Blob blob, long pos, int length,
int testNum, int blobLength) throws Exception {
try {
String subStr = new String(blob.getBytes(pos,length), "US-ASCII");
assertEquals("FAIL - getSubString returned wrong length ",
Math.min((b... | private void verifyInterval(Blob blob, long pos, int length,
int testNum, int blobLength) throws Exception {
try {
String subStr = new String(blob.getBytes(pos,length), "US-ASCII");
assertEquals("FAIL - getSubString returned wrong length ",
Math.min((b... |
public void testGetNewNames() throws IOException
{
Descriptor desc = Descriptor.fromFilename(new File("Keyspace1", "Standard1-500-Data.db").toString());
PendingFile inContext = new PendingFile(null, desc, "Data.db", Arrays.asList(new Pair<Long,Long>(0L, 1L)));
PendingFile outContext = S... | public void testGetNewNames() throws IOException
{
Descriptor desc = Descriptor.fromFilename(new File("Keyspace1", "Standard1-500-Data.db").toString());
PendingFile inContext = new PendingFile(null, desc, "Data.db", Arrays.asList(new Pair<Long,Long>(0L, 1L)), OperationType.BOOTSTRAP);
P... |
public void doVerb(Message message)
{
if (logger.isDebugEnabled())
logger.debug("Received a StreamRequestMessage from {}", message.getFrom());
byte[] body = message.getMessageBody();
ByteArrayInputStream bufIn = new ByteArrayInputStream(body);
try
{
... | public void doVerb(Message message)
{
if (logger.isDebugEnabled())
logger.debug("Received a StreamRequestMessage from {}", message.getFrom());
byte[] body = message.getMessageBody();
ByteArrayInputStream bufIn = new ByteArrayInputStream(body);
try
{
... |
public void finished(PendingFile remoteFile, PendingFile localFile) throws IOException
{
if (logger.isDebugEnabled())
logger.debug("Finished {}. Sending ack to {}", remoteFile, this);
Future future = CompactionManager.instance.submitSSTableBuild(localFile.desc);
buildFutures... | public void finished(PendingFile remoteFile, PendingFile localFile) throws IOException
{
if (logger.isDebugEnabled())
logger.debug("Finished {}. Sending ack to {}", remoteFile, this);
Future future = CompactionManager.instance.submitSSTableBuild(localFile.desc, remoteFile.type);
... |
private int getAbsoluteColumnPosition(Optimizable optTable)
{
ColumnReference cr = (ColumnReference) operand;
int columnPosition;
ConglomerateDescriptor bestCD;
/* Column positions are one-based, store is zero-based */
columnPosition = cr.getSource().getColumnPosition();
bestCD =
optTable.getTrulyThe... | private int getAbsoluteColumnPosition(Optimizable optTable)
{
ColumnReference cr = (ColumnReference) operand;
int columnPosition;
ConglomerateDescriptor bestCD;
/* Column positions are one-based, store is zero-based */
columnPosition = cr.getSource().getColumnPosition();
bestCD =
optTable.getTrulyThe... |
public void testBoostsSimple() throws Exception {
Map<CharSequence,Float> boosts = new HashMap<CharSequence,Float>();
boosts.put("b", Float.valueOf(5));
boosts.put("t", Float.valueOf(10));
String[] fields = { "b", "t" };
StandardQueryParser mfqp = new StandardQueryParser();
mfqp.setMultiFields... | public void testBoostsSimple() throws Exception {
Map<String,Float> boosts = new HashMap<String,Float>();
boosts.put("b", Float.valueOf(5));
boosts.put("t", Float.valueOf(10));
String[] fields = { "b", "t" };
StandardQueryParser mfqp = new StandardQueryParser();
mfqp.setMultiFields(fields);
... |
public void testBoostsSimple() throws Exception {
Map<CharSequence,Float> boosts = new HashMap<CharSequence,Float>();
boosts.put("b", Float.valueOf(5));
boosts.put("t", Float.valueOf(10));
String[] fields = { "b", "t" };
MultiFieldQueryParserWrapper mfqp = new MultiFieldQueryParserWrapper(
... | public void testBoostsSimple() throws Exception {
Map<String,Float> boosts = new HashMap<String,Float>();
boosts.put("b", Float.valueOf(5));
boosts.put("t", Float.valueOf(10));
String[] fields = { "b", "t" };
MultiFieldQueryParserWrapper mfqp = new MultiFieldQueryParserWrapper(
fields, new... |
private void setupCassandra() throws TException, InvalidRequestException
{
/* Establish a thrift connection to the cassandra instance */
TSocket socket = new TSocket(DatabaseDescriptor.getListenAddress().getHostName(), DatabaseDescriptor.getRpcPort());
TTransport transport = new TFramedT... | private void setupCassandra() throws TException, InvalidRequestException
{
/* Establish a thrift connection to the cassandra instance */
TSocket socket = new TSocket(DatabaseDescriptor.getListenAddress().getHostName(), DatabaseDescriptor.getRpcPort());
TTransport transport = new TFramedT... |
public void testConsumerBundle() throws Exception {
String testClassFileName = TestClass.class.getName().replace('.', '/') + ".class";
URL testClassURL = getClass().getResource("/" + testClassFileName);
String test2ClassFileName = Test2Class.class.getName().replace('.', '/') + ".class";
... | public void testConsumerBundle() throws Exception {
String testClassFileName = TestClass.class.getName().replace('.', '/') + ".class";
URL testClassURL = getClass().getResource("/" + testClassFileName);
String test2ClassFileName = Test2Class.class.getName().replace('.', '/') + ".class";
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.