buggy_function stringlengths 1 391k | fixed_function stringlengths 0 392k |
|---|---|
protected Reader initReader(Reader reader) {
return new MockCharFilter(CharReader.get(reader), 7);
}
};
assertAnalyzesTo(analyzer, "ab",
new String[] { "aab" },
new int[] { 0 },
new int[] { 2 }
);
assertAnalyzesTo(analyzer, "aba",
new String[... | protected Reader initReader(String fieldName, Reader reader) {
return new MockCharFilter(CharReader.get(reader), 7);
}
};
assertAnalyzesTo(analyzer, "ab",
new String[] { "aab" },
new int[] { 0 },
new int[] { 2 }
);
assertAnalyzesTo(analyzer, "aba",
... |
protected NamedList<? extends Object> analyzeValue(String value, AnalysisContext context) {
Analyzer analyzer = context.getAnalyzer();
if (!TokenizerChain.class.isInstance(analyzer)) {
TokenStream tokenStream = null;
try {
tokenStream = analyzer.tokenStream(context.getFieldName(), new S... | protected NamedList<? extends Object> analyzeValue(String value, AnalysisContext context) {
Analyzer analyzer = context.getAnalyzer();
if (!TokenizerChain.class.isInstance(analyzer)) {
TokenStream tokenStream = null;
try {
tokenStream = analyzer.tokenStream(context.getFieldName(), new S... |
protected Reader initReader(Reader reader) {
return charStream(reader);
}
} | protected Reader initReader(String fieldName, Reader reader) {
return charStream(reader);
}
} |
public void setGramSize(int gramSize) {
set("gramSize", Integer.toBinaryString(gramSize));
}
| public void setGramSize(int gramSize) {
set("gramSize", Integer.toString(gramSize));
}
|
protected void map(Text key, VectorWritable value, Context context)
throws IOException, InterruptedException {
if (!labelMap.containsKey(key.toString())) {
context.getCounter("NaiveBayes", "Skipped instance: not in label list");
return;
}
int label = labelMap.get(key.toString());
c... | protected void map(Text key, VectorWritable value, Context context)
throws IOException, InterruptedException {
if (!labelMap.containsKey(key.toString())) {
context.getCounter("NaiveBayes", "Skipped instance: not in label list").increment(1);
return;
}
int label = labelMap.get(key.toStr... |
public void testRandomStrings() throws IOException {
checkRandomData(random(), analyzer, atLeast(10000));
}
| public void testRandomStrings() throws IOException {
checkRandomData(random(), analyzer, atLeast(1000));
}
|
public void testRandomHugeStrings() throws Exception {
Random random = random();
final Analyzer a = new JapaneseAnalyzer(TEST_VERSION_CURRENT, null, Mode.SEARCH,
JapaneseAnalyzer.getDefaultStopSet(),
JapaneseAnalyzer.getDefaultStopTags());
checkRandomData(random, a, 200*RANDOM_MULTIPLIER, ... | public void testRandomHugeStrings() throws Exception {
Random random = random();
final Analyzer a = new JapaneseAnalyzer(TEST_VERSION_CURRENT, null, Mode.SEARCH,
JapaneseAnalyzer.getDefaultStopSet(),
JapaneseAnalyzer.getDefaultStopTags());
checkRandomData(random, a, 100*RANDOM_MULTIPLIER, ... |
public void testRandomData() throws IOException {
checkRandomData(random(), analyzer, 10000*RANDOM_MULTIPLIER);
}
| public void testRandomData() throws IOException {
checkRandomData(random(), analyzer, 1000*RANDOM_MULTIPLIER);
}
|
public void testRandomStrings() throws Exception {
checkRandomData(random(), new ItalianAnalyzer(TEST_VERSION_CURRENT), 10000*RANDOM_MULTIPLIER);
}
| public void testRandomStrings() throws Exception {
checkRandomData(random(), new ItalianAnalyzer(TEST_VERSION_CURRENT), 1000*RANDOM_MULTIPLIER);
}
|
public void testRandomStrings() throws Exception {
checkRandomData(random(), analyzer, 10000*RANDOM_MULTIPLIER);
}
| public void testRandomStrings() throws Exception {
checkRandomData(random(), analyzer, 1000*RANDOM_MULTIPLIER);
}
|
public void testRandomStrings() throws Exception {
checkRandomData(random(), new CzechAnalyzer(TEST_VERSION_CURRENT), 10000*RANDOM_MULTIPLIER);
}
| public void testRandomStrings() throws Exception {
checkRandomData(random(), new CzechAnalyzer(TEST_VERSION_CURRENT), 1000*RANDOM_MULTIPLIER);
}
|
public void testRandomStrings() throws Exception {
checkRandomData(random(), new DanishAnalyzer(TEST_VERSION_CURRENT), 10000*RANDOM_MULTIPLIER);
}
| public void testRandomStrings() throws Exception {
checkRandomData(random(), new DanishAnalyzer(TEST_VERSION_CURRENT), 1000*RANDOM_MULTIPLIER);
}
|
public void testRandomStrings() throws Exception {
checkRandomData(random(), new PersianAnalyzer(TEST_VERSION_CURRENT), 10000*RANDOM_MULTIPLIER);
}
| public void testRandomStrings() throws Exception {
checkRandomData(random(), new PersianAnalyzer(TEST_VERSION_CURRENT), 1000*RANDOM_MULTIPLIER);
}
|
public void testRandomStrings() throws Exception {
checkRandomData(random(), new BulgarianAnalyzer(TEST_VERSION_CURRENT), 10000*RANDOM_MULTIPLIER);
}
| public void testRandomStrings() throws Exception {
checkRandomData(random(), new BulgarianAnalyzer(TEST_VERSION_CURRENT), 1000*RANDOM_MULTIPLIER);
}
|
public void testRandomStrings() throws Exception {
checkRandomData(random(), new UAX29URLEmailAnalyzer(TEST_VERSION_CURRENT), 10000*RANDOM_MULTIPLIER);
}
| public void testRandomStrings() throws Exception {
checkRandomData(random(), new UAX29URLEmailAnalyzer(TEST_VERSION_CURRENT), 1000*RANDOM_MULTIPLIER);
}
|
public void testRandomStrings() throws Exception {
checkRandomData(random(), new KeywordAnalyzer(), 10000*RANDOM_MULTIPLIER);
}
| public void testRandomStrings() throws Exception {
checkRandomData(random(), new KeywordAnalyzer(), 1000*RANDOM_MULTIPLIER);
}
|
public void testRandomStrings() throws Exception {
checkRandomData(random(), new GermanAnalyzer(TEST_VERSION_CURRENT), 10000*RANDOM_MULTIPLIER);
}
| public void testRandomStrings() throws Exception {
checkRandomData(random(), new GermanAnalyzer(TEST_VERSION_CURRENT), 1000*RANDOM_MULTIPLIER);
}
|
public void testRandomStrings() throws Exception {
checkRandomData(random(), new SwedishAnalyzer(TEST_VERSION_CURRENT), 10000*RANDOM_MULTIPLIER);
}
| public void testRandomStrings() throws Exception {
checkRandomData(random(), new SwedishAnalyzer(TEST_VERSION_CURRENT), 1000*RANDOM_MULTIPLIER);
}
|
public void testRandomStrings() throws Exception {
checkRandomData(random(), new FinnishAnalyzer(TEST_VERSION_CURRENT), 10000*RANDOM_MULTIPLIER);
}
| public void testRandomStrings() throws Exception {
checkRandomData(random(), new FinnishAnalyzer(TEST_VERSION_CURRENT), 1000*RANDOM_MULTIPLIER);
}
|
public void testRandomStrings() throws Exception {
checkRandomData(random(), new HindiAnalyzer(TEST_VERSION_CURRENT), 10000*RANDOM_MULTIPLIER);
}
| public void testRandomStrings() throws Exception {
checkRandomData(random(), new HindiAnalyzer(TEST_VERSION_CURRENT), 1000*RANDOM_MULTIPLIER);
}
|
public void testRandomStrings() throws Exception {
checkRandomData(random(), new BrazilianAnalyzer(TEST_VERSION_CURRENT), 10000*RANDOM_MULTIPLIER);
}
| public void testRandomStrings() throws Exception {
checkRandomData(random(), new BrazilianAnalyzer(TEST_VERSION_CURRENT), 1000*RANDOM_MULTIPLIER);
}
|
public void testRandomStrings() throws Exception {
checkRandomData(random(), new FrenchAnalyzer(TEST_VERSION_CURRENT), 10000*RANDOM_MULTIPLIER);
}
| public void testRandomStrings() throws Exception {
checkRandomData(random(), new FrenchAnalyzer(TEST_VERSION_CURRENT), 1000*RANDOM_MULTIPLIER);
}
|
public void testRandomStrings() throws Exception {
checkRandomData(random(), new DutchAnalyzer(TEST_VERSION_CURRENT), 10000*RANDOM_MULTIPLIER);
}
| public void testRandomStrings() throws Exception {
checkRandomData(random(), new DutchAnalyzer(TEST_VERSION_CURRENT), 1000*RANDOM_MULTIPLIER);
}
|
public void testRandomStrings() throws Exception {
checkRandomData(random(), new HungarianAnalyzer(TEST_VERSION_CURRENT), 10000*RANDOM_MULTIPLIER);
}
| public void testRandomStrings() throws Exception {
checkRandomData(random(), new HungarianAnalyzer(TEST_VERSION_CURRENT), 1000*RANDOM_MULTIPLIER);
}
|
public void testRandomStrings() throws Exception {
checkRandomData(random(), new NorwegianAnalyzer(TEST_VERSION_CURRENT), 10000*RANDOM_MULTIPLIER);
}
| public void testRandomStrings() throws Exception {
checkRandomData(random(), new NorwegianAnalyzer(TEST_VERSION_CURRENT), 1000*RANDOM_MULTIPLIER);
}
|
public void testRandomStrings() throws Exception {
Random random = random();
checkRandomData(random, analyzer, 10000*RANDOM_MULTIPLIER);
}
| public void testRandomStrings() throws Exception {
Random random = random();
checkRandomData(random, analyzer, 1000*RANDOM_MULTIPLIER);
}
|
public void testRandomStrings() throws Exception {
checkRandomData(random(), new RomanianAnalyzer(TEST_VERSION_CURRENT), 10000*RANDOM_MULTIPLIER);
}
| public void testRandomStrings() throws Exception {
checkRandomData(random(), new RomanianAnalyzer(TEST_VERSION_CURRENT), 1000*RANDOM_MULTIPLIER);
}
|
public void testRandomStrings() throws Exception {
checkRandomData(random(), new ArmenianAnalyzer(TEST_VERSION_CURRENT), 10000*RANDOM_MULTIPLIER);
}
| public void testRandomStrings() throws Exception {
checkRandomData(random(), new ArmenianAnalyzer(TEST_VERSION_CURRENT), 1000*RANDOM_MULTIPLIER);
}
|
public void testRandomStrings() throws Exception {
checkRandomData(random(), new LatvianAnalyzer(TEST_VERSION_CURRENT), 10000*RANDOM_MULTIPLIER);
}
| public void testRandomStrings() throws Exception {
checkRandomData(random(), new LatvianAnalyzer(TEST_VERSION_CURRENT), 1000*RANDOM_MULTIPLIER);
}
|
public void testRandomStrings() throws Exception {
checkRandomData(random(), new PortugueseAnalyzer(TEST_VERSION_CURRENT), 10000*RANDOM_MULTIPLIER);
}
| public void testRandomStrings() throws Exception {
checkRandomData(random(), new PortugueseAnalyzer(TEST_VERSION_CURRENT), 1000*RANDOM_MULTIPLIER);
}
|
public void testRandomStrings() throws Exception {
checkRandomData(random(), new CatalanAnalyzer(TEST_VERSION_CURRENT), 10000*RANDOM_MULTIPLIER);
}
| public void testRandomStrings() throws Exception {
checkRandomData(random(), new CatalanAnalyzer(TEST_VERSION_CURRENT), 1000*RANDOM_MULTIPLIER);
}
|
public void testRandomStrings() throws Exception {
checkRandomData(random(), new TurkishAnalyzer(TEST_VERSION_CURRENT), 10000*RANDOM_MULTIPLIER);
}
| public void testRandomStrings() throws Exception {
checkRandomData(random(), new TurkishAnalyzer(TEST_VERSION_CURRENT), 1000*RANDOM_MULTIPLIER);
}
|
public void testRandomStrings() throws Exception {
checkRandomData(random(), new RussianAnalyzer(TEST_VERSION_CURRENT), 10000*RANDOM_MULTIPLIER);
}
| public void testRandomStrings() throws Exception {
checkRandomData(random(), new RussianAnalyzer(TEST_VERSION_CURRENT), 1000*RANDOM_MULTIPLIER);
}
|
public void testRandomStrings() throws Exception {
checkRandomData(random(), new IrishAnalyzer(TEST_VERSION_CURRENT), 10000*RANDOM_MULTIPLIER);
}
| public void testRandomStrings() throws Exception {
checkRandomData(random(), new IrishAnalyzer(TEST_VERSION_CURRENT), 1000*RANDOM_MULTIPLIER);
}
|
protected TokenStreamComponents createComponents(String fieldName, Reader reader) {
Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
return new TokenStreamComponents(tokenizer, new HunspellStemFilter(tokenizer, DICTIONARY));
}
};
checkRandomData(ran... | protected TokenStreamComponents createComponents(String fieldName, Reader reader) {
Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
return new TokenStreamComponents(tokenizer, new HunspellStemFilter(tokenizer, DICTIONARY));
}
};
checkRandomData(ran... |
public void testRandomStrings() throws Exception {
checkRandomData(random(), new IndonesianAnalyzer(TEST_VERSION_CURRENT), 10000*RANDOM_MULTIPLIER);
}
| public void testRandomStrings() throws Exception {
checkRandomData(random(), new IndonesianAnalyzer(TEST_VERSION_CURRENT), 1000*RANDOM_MULTIPLIER);
}
|
public void testRandomStrings() throws Exception {
checkRandomData(random(), new GreekAnalyzer(TEST_VERSION_CURRENT), 10000*RANDOM_MULTIPLIER);
}
| public void testRandomStrings() throws Exception {
checkRandomData(random(), new GreekAnalyzer(TEST_VERSION_CURRENT), 1000*RANDOM_MULTIPLIER);
}
|
public void testRandomStrings() throws Exception {
checkRandomData(random(), new GalicianAnalyzer(TEST_VERSION_CURRENT), 10000*RANDOM_MULTIPLIER);
}
| public void testRandomStrings() throws Exception {
checkRandomData(random(), new GalicianAnalyzer(TEST_VERSION_CURRENT), 1000*RANDOM_MULTIPLIER);
}
|
public void testRandomStrings() throws Exception {
checkRandomData(random(), new ArabicAnalyzer(TEST_VERSION_CURRENT), 10000*RANDOM_MULTIPLIER);
}
| public void testRandomStrings() throws Exception {
checkRandomData(random(), new ArabicAnalyzer(TEST_VERSION_CURRENT), 1000*RANDOM_MULTIPLIER);
}
|
public void testRandomStrings() throws Exception {
checkRandomData(random(), new EnglishAnalyzer(TEST_VERSION_CURRENT), 10000*RANDOM_MULTIPLIER);
}
| public void testRandomStrings() throws Exception {
checkRandomData(random(), new EnglishAnalyzer(TEST_VERSION_CURRENT), 1000*RANDOM_MULTIPLIER);
}
|
protected TokenStreamComponents createComponents(String fieldName, Reader reader) {
Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
return new TokenStreamComponents(tokenizer, new HyphenatedWordsFilter(tokenizer));
}
};
checkRandomData(random(),... | protected TokenStreamComponents createComponents(String fieldName, Reader reader) {
Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
return new TokenStreamComponents(tokenizer, new HyphenatedWordsFilter(tokenizer));
}
};
checkRandomData(random(),... |
protected TokenStreamComponents createComponents(String fieldName, Reader reader) {
Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
return new TokenStreamComponents(tokenizer, new CapitalizationFilter(tokenizer));
}
};
checkRandomData(random(), ... | protected TokenStreamComponents createComponents(String fieldName, Reader reader) {
Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
return new TokenStreamComponents(tokenizer, new CapitalizationFilter(tokenizer));
}
};
checkRandomData(random(), ... |
protected TokenStreamComponents createComponents(String fieldName, Reader reader) {
Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
TokenStream stream = new KeepWordFilter(true, tokenizer, new CharArraySet(TEST_VERSION_CURRENT, words, true));
return new To... | protected TokenStreamComponents createComponents(String fieldName, Reader reader) {
Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
TokenStream stream = new KeepWordFilter(true, tokenizer, new CharArraySet(TEST_VERSION_CURRENT, words, true));
return new To... |
public void testRandomStrings() throws Exception {
checkRandomData(random(), new SpanishAnalyzer(TEST_VERSION_CURRENT), 10000*RANDOM_MULTIPLIER);
}
| public void testRandomStrings() throws Exception {
checkRandomData(random(), new SpanishAnalyzer(TEST_VERSION_CURRENT), 1000*RANDOM_MULTIPLIER);
}
|
public void testRandomStrings() throws Exception {
checkRandomData(random(), new BasqueAnalyzer(TEST_VERSION_CURRENT), 10000*RANDOM_MULTIPLIER);
}
| public void testRandomStrings() throws Exception {
checkRandomData(random(), new BasqueAnalyzer(TEST_VERSION_CURRENT), 1000*RANDOM_MULTIPLIER);
}
|
protected TokenStreamComponents createComponents(String fieldName, Reader reader) {
Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
return new TokenStreamComponents(tokenizer, new ReverseStringFilter(TEST_VERSION_CURRENT, tokenizer));
}
};
checkRando... | protected TokenStreamComponents createComponents(String fieldName, Reader reader) {
Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
return new TokenStreamComponents(tokenizer, new ReverseStringFilter(TEST_VERSION_CURRENT, tokenizer));
}
};
checkRando... |
public void testRandom() throws Exception {
checkRandomData(random(), getTestAnalyzer(), 10000 * RANDOM_MULTIPLIER);
}
| public void testRandom() throws Exception {
checkRandomData(random(), getTestAnalyzer(), 1000 * RANDOM_MULTIPLIER);
}
|
public void testRandomStrings() throws Exception {
checkRandomData(random(), new PolishAnalyzer(TEST_VERSION_CURRENT), 10000*RANDOM_MULTIPLIER);
}
| public void testRandomStrings() throws Exception {
checkRandomData(random(), new PolishAnalyzer(TEST_VERSION_CURRENT), 1000*RANDOM_MULTIPLIER);
}
|
public SortedSetDocValues getDocTermOrds(AtomicReader reader, String field) throws IOException {
SortedSetDocValues dv = reader.getSortedSetDocValues(field);
if (dv != null) {
return dv;
}
SortedDocValues sdv = reader.getSortedDocValues(field);
if (sdv != null) {
return new Single... | public SortedSetDocValues getDocTermOrds(AtomicReader reader, String field) throws IOException {
SortedSetDocValues dv = reader.getSortedSetDocValues(field);
if (dv != null) {
return dv;
}
SortedDocValues sdv = reader.getSortedDocValues(field);
if (sdv != null) {
return new Single... |
public CoreParser(Analyzer analyzer, QueryParser parser)
{
this.analyzer=analyzer;
this.parser=parser;
filterFactory = new FilterBuilderFactory();
filterFactory.addBuilder("RangeFilter",new RangeFilterBuilder());
queryFactory = new QueryBuilderFactory();
queryFactory.addBuilder("TermQuery",new TermQ... | public CoreParser(Analyzer analyzer, QueryParser parser)
{
this.analyzer=analyzer;
this.parser=parser;
filterFactory = new FilterBuilderFactory();
filterFactory.addBuilder("RangeFilter",new RangeFilterBuilder());
queryFactory = new QueryBuilderFactory();
queryFactory.addBuilder("TermQuery",new TermQ... |
public static List<Row> readProtocol(List<ReadCommand> commands, ConsistencyLevel consistency_level)
throws IOException, UnavailableException, TimeoutException, InvalidRequestException
{
if (StorageService.instance.isBootstrapMode())
throw new InvalidRequestException("This node c... | public static List<Row> readProtocol(List<ReadCommand> commands, ConsistencyLevel consistency_level)
throws IOException, UnavailableException, TimeoutException, InvalidRequestException
{
if (StorageService.instance.isBootstrapMode())
throw new UnavailableException();
long... |
public static void writeVector(DataOutput out, Vector vector, boolean laxPrecision) throws IOException {
boolean dense = vector.isDense();
boolean sequential = vector.isSequentialAccess();
boolean named = vector instanceof NamedVector;
out.writeByte((dense ? FLAG_DENSE : 0)
| (sequential ? FL... | public static void writeVector(DataOutput out, Vector vector, boolean laxPrecision) throws IOException {
boolean dense = vector.isDense();
boolean sequential = vector.isSequentialAccess();
boolean named = vector instanceof NamedVector;
out.writeByte((dense ? FLAG_DENSE : 0)
| (sequential ? FL... |
public void reload(String name) {
try {
name = checkDefault(name);
SolrCore core = solrCores.getCoreFromAnyList(name, false);
if (core == null)
throw new SolrException( SolrException.ErrorCode.BAD_REQUEST, "No such core: " + name );
try {
solrCores.waitAddPendingCoreOps(n... | public void reload(String name) {
try {
name = checkDefault(name);
SolrCore core = solrCores.getCoreFromAnyList(name, false);
if (core == null)
throw new SolrException( SolrException.ErrorCode.BAD_REQUEST, "No such core: " + name );
try {
solrCores.waitAddPendingCoreOps(n... |
protected Rectangle gridSnapp(Shape snapMe) {
//The next 4 lines mimic PrefixTreeStrategy.createIndexableFields()
double distErrPct = ((PrefixTreeStrategy) strategy).getDistErrPct();
double distErr = SpatialArgs.calcDistanceFromErrPct(snapMe, distErrPct, ctx);
int detailLevel = grid.getLevelForDistanc... | protected Rectangle gridSnapp(Shape snapMe) {
//The next 4 lines mimic PrefixTreeStrategy.createIndexableFields()
double distErrPct = ((PrefixTreeStrategy) strategy).getDistErrPct();
double distErr = SpatialArgs.calcDistanceFromErrPct(snapMe, distErrPct, ctx);
int detailLevel = grid.getLevelForDistanc... |
public void start(InetAddress localEndPoint, int generationNbr)
{
localEndPoint_ = localEndPoint;
/* Get the seeds from the config and initialize them. */
Set<InetAddress> seedHosts = DatabaseDescriptor.getSeeds();
for (InetAddress seed : seedHosts)
{
if (seed... | public void start(InetAddress localEndPoint, int generationNbr)
{
localEndPoint_ = localEndPoint;
/* Get the seeds from the config and initialize them. */
Set<InetAddress> seedHosts = DatabaseDescriptor.getSeeds();
for (InetAddress seed : seedHosts)
{
if (seed... |
public void bindStatement() throws StandardException
{
DataDictionary dataDictionary = getDataDictionary();
int numPrimaryKeys = 0;
int numCheckConstraints = 0;
int numReferenceConstraints = 0;
int numUniqueConstraints = 0;
int numGenerationClauses = 0;
SchemaDescriptor sd = getSchemaDescri... | public void bindStatement() throws StandardException
{
DataDictionary dataDictionary = getDataDictionary();
int numPrimaryKeys = 0;
int numCheckConstraints = 0;
int numReferenceConstraints = 0;
int numUniqueConstraints = 0;
int numGenerationClauses = 0;
SchemaDescriptor sd = getSchemaDescri... |
public void bindStatement() throws StandardException
{
DataDictionary dd = getDataDictionary();
int numCheckConstraints = 0;
int numReferenceConstraints = 0;
int numGenerationClauses = 0;
int numBackingIndexes = 0;
/*
** Get the table descriptor. Checks the schema
** and the table.
*/
... | public void bindStatement() throws StandardException
{
DataDictionary dd = getDataDictionary();
int numCheckConstraints = 0;
int numReferenceConstraints = 0;
int numGenerationClauses = 0;
int numBackingIndexes = 0;
/*
** Get the table descriptor. Checks the schema
** and the table.
*/
... |
protected String getReduced()
{
return current;
}
};
try
{
// pull keys out of the CollatedIterator. checking tombstone status is expensive,
// so we set an arbitrary limit on how many we'll do at once.
Lis... | protected String getReduced()
{
return current;
}
};
try
{
// pull keys out of the CollatedIterator. checking tombstone status is expensive,
// so we set an arbitrary limit on how many we'll do at once.
Lis... |
protected boolean execute() throws SQLException
{
boolean hasResultSet = ps.execute();
// DERBY-3085 - We need to make sure we drain the streamed parameter
// if not used by the server, for example if an update statement does not
// update any rows, the parameter won't be used. Network Server will
// stre... | protected boolean execute() throws SQLException
{
boolean hasResultSet = ps.execute();
// DERBY-3085 - We need to make sure we drain the streamed parameter
// if not used by the server, for example if an update statement does not
// update any rows, the parameter won't be used. Network Server will
// stre... |
public static void main(String[] args) throws Throwable
{
int port = 9160;
try
{
CassandraServer peerStorageServer = new CassandraServer();
peerStorageServer.start();
Cassandra.Processor processor = new Cassandra.Processor(
peerStorageServer);
// Transport
TServerSocket tServerSocket = ne... | public static void main(String[] args) throws Throwable
{
int port = DatabaseDescriptor.getThriftPort();
try
{
CassandraServer peerStorageServer = new CassandraServer();
peerStorageServer.start();
Cassandra.Processor processor = new Cassandra.Processor(
peerStorageServer);
// Transport
TServ... |
private long processOneUser(long averageCount, long userID) throws TasteException {
log.debug("Processing prefs for user {}", userID);
// Save off prefs for the life of this loop iteration
PreferenceArray userPreferences = dataModel.getPreferencesFromUser(userID);
int length = userPreferences.length()... | private long processOneUser(long averageCount, long userID) throws TasteException {
log.debug("Processing prefs for user {}", userID);
// Save off prefs for the life of this loop iteration
PreferenceArray userPreferences = dataModel.getPreferencesFromUser(userID);
int length = userPreferences.length()... |
private static List<Row> strongRead(List<ReadCommand> commands, ConsistencyLevel consistency_level) throws IOException, UnavailableException, TimeoutException
{
List<QuorumResponseHandler<Row>> quorumResponseHandlers = new ArrayList<QuorumResponseHandler<Row>>();
List<List<InetAddress>> commandE... | private static List<Row> strongRead(List<ReadCommand> commands, ConsistencyLevel consistency_level) throws IOException, UnavailableException, TimeoutException
{
List<QuorumResponseHandler<Row>> quorumResponseHandlers = new ArrayList<QuorumResponseHandler<Row>>();
List<List<InetAddress>> commandE... |
public static int getGenerationFromFileName(String filename)
{
/*
* File name is of the form <table>-<column family>-<index>-Data.db.
* This tokenizer will strip the .db portion.
*/
StringTokenizer st = new StringTokenizer(filename, "-");
/*
* Now I wa... | public static int getGenerationFromFileName(String filename)
{
/*
* File name is of the form <table>-<column family>-<index>-Data.db.
* This tokenizer will strip the .db portion.
*/
StringTokenizer st = new StringTokenizer(filename, "-");
/*
* Now I wa... |
String REPLICATION_NOT_IN_MASTER_MODE = "XRE07";
/*
Derby - Class org.apache.derby.shared.common.reference.SQLState
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional in... | String REPLICATION_NOT_IN_MASTER_MODE = "XRE07";
/*
Derby - Class org.apache.derby.shared.common.reference.SQLState
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional in... |
private Job writeDocTopicInference(Configuration conf, Path corpus, Path modelInput, Path output)
throws IOException, ClassNotFoundException, InterruptedException {
String jobName = String.format("Writing final document/topic inference from %s to %s", corpus, output);
log.info("About to run: {}", jobName)... | private Job writeDocTopicInference(Configuration conf, Path corpus, Path modelInput, Path output)
throws IOException, ClassNotFoundException, InterruptedException {
String jobName = String.format("Writing final document/topic inference from %s to %s", corpus, output);
log.info("About to run: {}", jobName)... |
public static void main(String args[]) {
// adjust the application in accordance with derby.ui.locale and derby.ui.codeset
LocalizedResource.getInstance();
LocalizedOutput out;
//using AppStreamReader(extends InputStreamReader) for conversion into specific codeset
out = LocalizedResourc... | public static void main(String args[]) {
// adjust the application in accordance with derby.ui.locale and derby.ui.codeset
LocalizedResource.getInstance().init();
LocalizedOutput out;
//using AppStreamReader(extends InputStreamReader) for conversion into specific codeset
out = Localized... |
public synchronized Connection getConnection() throws SQLException
{
checkActive();
// RealConnection is not null if the app server yanks a local
// connection from one client and give it to another. In this case,
// the real connection is ready to be used. Otherwise, set it up
if (realConnection == null... | public synchronized Connection getConnection() throws SQLException
{
checkActive();
// RealConnection is not null if the app server yanks a local
// connection from one client and give it to another. In this case,
// the real connection is ready to be used. Otherwise, set it up
if (realConnection == null... |
private void writeSQLCAGRP(SQLException e, int sqlcode, int updateCount,
long rowCount) throws DRDAProtocolException
{
String sqlerrmc;
String sqlState;
String severeExceptionInfo = null;
SQLException nextException = null;
if (rowCount < 0 && updateCount < 0)
{
writer.writeByte(CodePoint.NULLDATA);... | private void writeSQLCAGRP(SQLException e, int sqlcode, int updateCount,
long rowCount) throws DRDAProtocolException
{
String sqlerrmc;
String sqlState;
String severeExceptionInfo = null;
SQLException nextException = null;
if (rowCount < 0 && updateCount < 0)
{
writer.writeByte(CodePoint.NULLDATA);... |
public void testBaseDir() throws Exception {
final File base = _TestUtil.getTempDir("fsResourceLoaderBase");
try {
base.mkdirs();
Writer os = new OutputStreamWriter(new FileOutputStream(new File(base, "template.txt")), IOUtils.CHARSET_UTF_8);
try {
os.write("foobar\n");
} final... | public void testBaseDir() throws Exception {
final File base = _TestUtil.getTempDir("fsResourceLoaderBase").getAbsoluteFile();
try {
base.mkdirs();
Writer os = new OutputStreamWriter(new FileOutputStream(new File(base, "template.txt")), IOUtils.CHARSET_UTF_8);
try {
os.write("foobar\... |
public void start()
{
logger.info("Cassandra starting up...");
Mx4jTool.maybeLoad();
serverEngine.serve();
}
| public void start()
{
logger.info("Listening for thrift clients...");
Mx4jTool.maybeLoad();
serverEngine.serve();
}
|
public void start() throws IOException
{
if (logger.isDebugEnabled())
logger.debug(String.format("Binding avro service to %s:%s", listenAddr, listenPort));
SpecificResponder responder = new SpecificResponder(Cassandra.class, new CassandraServer());
logger.info("Cassa... | public void start() throws IOException
{
if (logger.isDebugEnabled())
logger.debug(String.format("Binding avro service to %s:%s", listenAddr, listenPort));
SpecificResponder responder = new SpecificResponder(Cassandra.class, new CassandraServer());
logger.info("Liste... |
public static Option[] configuration() {
Option[] options = CoreOptions.options(CoreOptions.equinox(), mavenBundle("org.ops4j.pax.logging",
"pax-logging-api"), mavenBundle("org.ops4j.pax.logging", "pax-logging-service"), mavenBundle(
"org.apache.aries.jmx", "org.apache.aries.... | public static Option[] configuration() {
Option[] options = CoreOptions.options(CoreOptions.equinox(), mavenBundle("org.ops4j.pax.logging",
"pax-logging-api"), mavenBundle("org.ops4j.pax.logging", "pax-logging-service"), mavenBundle(
"org.apache.aries.jmx", "org.apache.aries.... |
public static Test suite()
{
TestSuite suite = (TestSuite) TestConfiguration.embeddedSuite(AnsiSignaturesTest.class);
return new CleanDatabaseTestSetup( suite );
}
| public static Test suite()
{
TestSuite suite = (TestSuite) TestConfiguration.defaultSuite(AnsiSignaturesTest.class);
return new CleanDatabaseTestSetup( suite );
}
|
public static List<Row> getRangeSlice(RangeSliceCommand command, ConsistencyLevel consistency_level)
throws IOException, UnavailableException, TimeoutException
{
if (logger.isDebugEnabled())
logger.debug(command);
long startTime = System.nanoTime();
final String table = ... | public static List<Row> getRangeSlice(RangeSliceCommand command, ConsistencyLevel consistency_level)
throws IOException, UnavailableException, TimeoutException
{
if (logger.isDebugEnabled())
logger.debug(command);
long startTime = System.nanoTime();
final String table = ... |
public Pair<AbstractBounds,AbstractBounds> split(Token token)
{
assert contains(token);
AbstractBounds lb = createFrom(token);
// we contain this token, so only one of the left or right can be empty
AbstractBounds rb = lb != null && token.equals(right) ? null : new Range(token, r... | public Pair<AbstractBounds,AbstractBounds> split(Token token)
{
assert left.equals(token) || contains(token);
AbstractBounds lb = createFrom(token);
// we contain this token, so only one of the left or right can be empty
AbstractBounds rb = lb != null && token.equals(right) ? nul... |
public void testAddIndexOnDiskFull() throws IOException
{
// MemoryCodec, since it uses FST, is not necessarily
// "additive", ie if you add up N small FSTs, then merge
// them, the merged result can easily be larger than the
// sum because the merged FST may use array encoding for
// some arcs ... | public void testAddIndexOnDiskFull() throws IOException
{
// MemoryCodec, since it uses FST, is not necessarily
// "additive", ie if you add up N small FSTs, then merge
// them, the merged result can easily be larger than the
// sum because the merged FST may use array encoding for
// some arcs ... |
private void assertChunking(Random random, int chunkSize) throws Exception {
File path = File.createTempFile("mmap" + chunkSize, "tmp", workDir);
path.delete();
path.mkdirs();
MMapDirectory dir = new MMapDirectory(path);
dir.setMaxChunkSize(chunkSize);
// we will map a lot, try to turn on the ... | private void assertChunking(Random random, int chunkSize) throws Exception {
File path = _TestUtil.createTempFile("mmap" + chunkSize, "tmp", workDir);
path.delete();
path.mkdirs();
MMapDirectory dir = new MMapDirectory(path);
dir.setMaxChunkSize(chunkSize);
// we will map a lot, try to turn on... |
public void testReadBytes() throws Exception {
MyBufferedIndexInput input = new MyBufferedIndexInput();
runReadBytes(input, BufferedIndexInput.BUFFER_SIZE, random);
// This tests the workaround code for LUCENE-1566 where readBytesInternal
// provides a workaround for a JVM Bug that incorrectly raises... | public void testReadBytes() throws Exception {
MyBufferedIndexInput input = new MyBufferedIndexInput();
runReadBytes(input, BufferedIndexInput.BUFFER_SIZE, random);
// This tests the workaround code for LUCENE-1566 where readBytesInternal
// provides a workaround for a JVM Bug that incorrectly raises... |
public Query parse() throws ParseException {
SolrParams localParams = getLocalParams();
SolrParams params = getParams();
solrParams = SolrParams.wrapDefaults(localParams, params);
final String minShouldMatch =
DisMaxQParser.parseMinShouldMatch(req.getSchema(), solrParams);
userFields... | public Query parse() throws ParseException {
SolrParams localParams = getLocalParams();
SolrParams params = getParams();
solrParams = SolrParams.wrapDefaults(localParams, params);
final String minShouldMatch =
DisMaxQParser.parseMinShouldMatch(req.getSchema(), solrParams);
userFields... |
public void nameAllResultColumns()
throws StandardException
{
int size = size();
for (int index = 0; index < size; index++)
{
ResultColumn resultColumn = (ResultColumn) elementAt(index);
resultColumn.guaranteeColumnName();
}
}
/**
** Check whether the column lengths and types of the resu... | public void nameAllResultColumns()
throws StandardException
{
int size = size();
for (int index = 0; index < size; index++)
{
ResultColumn resultColumn = (ResultColumn) elementAt(index);
resultColumn.guaranteeColumnName();
}
}
/**
** Check whether the column lengths and types of the resu... |
public static Test suite() {
return TestConfiguration.clientServerDecorator(LobLimitsTest.suite());
}
| public static Test suite() {
return (TestConfiguration.clientServerDecorator(LobLimitsTest.suite()));
}
|
public boolean jdbcCompliant() {
return false;
}
| public boolean jdbcCompliant() {
return true;
}
|
public void start(BundleContext context) {
LOGGER.debug("Starting blueprint extender...");
this.context = context;
handlers = new NamespaceHandlerRegistryImpl(context);
executors = Executors.newScheduledThreadPool(3);
eventDispatcher = new BlueprintEventDispatcher(context, e... | public void start(BundleContext context) {
LOGGER.debug("Starting blueprint extender...");
this.context = context;
handlers = new NamespaceHandlerRegistryImpl(context);
executors = Executors.newScheduledThreadPool(3, new BlueprintThreadFactory("Blueprint Extender"));
eventDi... |
public String toString() {
StringBuilder result = new StringBuilder(200);
result.append("GenericBooleanPrefDataModel[users:");
for (int i = 0; i < Math.min(3, userIDs.length); i++) {
if (i > 0) {
result.append(',');
}
result.append(userIDs[i]);
}
if (result.length() > 3) ... | public String toString() {
StringBuilder result = new StringBuilder(200);
result.append("GenericBooleanPrefDataModel[users:");
for (int i = 0; i < Math.min(3, userIDs.length); i++) {
if (i > 0) {
result.append(',');
}
result.append(userIDs[i]);
}
if (userIDs.length > 3) {... |
public String toString() {
StringBuilder result = new StringBuilder(200);
result.append("GenericDataModel[users:");
for (int i = 0; i < Math.min(3, userIDs.length); i++) {
if (i > 0) {
result.append(',');
}
result.append(userIDs[i]);
}
if (result.length() > 3) {
res... | public String toString() {
StringBuilder result = new StringBuilder(200);
result.append("GenericDataModel[users:");
for (int i = 0; i < Math.min(3, userIDs.length); i++) {
if (i > 0) {
result.append(',');
}
result.append(userIDs[i]);
}
if (userIDs.length > 3) {
resu... |
private static final String LOADBALANCE_STAGE = "LOAD-BALANCER-STAGE";
static
{
stages.put(MUTATION_STAGE, multiThreadedStage(MUTATION_STAGE, getConcurrentWriters()));
stages.put(READ_STAGE, multiThreadedStage(READ_STAGE, getConcurrentReaders()));
stages.put(RESPONSE_STAGE, multiThr... | private static final String LOADBALANCE_STAGE = "LOAD-BALANCER-STAGE";
static
{
stages.put(MUTATION_STAGE, multiThreadedStage(MUTATION_STAGE, getConcurrentWriters()));
stages.put(READ_STAGE, multiThreadedStage(READ_STAGE, getConcurrentReaders()));
stages.put(RESPONSE_STAGE, multiThr... |
public void testRandomSortedBytes() throws IOException {
Directory dir = newDirectory();
IndexWriterConfig cfg = newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random()));
IndexWriter w = new IndexWriter(dir, cfg);
int numDocs = atLeast(100);
BytesRefHash hash = new BytesRefHash();
... | public void testRandomSortedBytes() throws IOException {
Directory dir = newDirectory();
IndexWriterConfig cfg = newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random()));
IndexWriter w = new IndexWriter(dir, cfg);
int numDocs = atLeast(100);
BytesRefHash hash = new BytesRefHash();
... |
public void testForceMergeDeletes() throws Exception {
Directory dir = newDirectory();
IndexWriterConfig conf = newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random()));
TieredMergePolicy tmp = newTieredMergePolicy();
conf.setMergePolicy(tmp);
conf.setMaxBufferedDocs(4);
tmp.setM... | public void testForceMergeDeletes() throws Exception {
Directory dir = newDirectory();
IndexWriterConfig conf = newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random()));
TieredMergePolicy tmp = newTieredMergePolicy();
conf.setMergePolicy(tmp);
conf.setMaxBufferedDocs(4);
tmp.setM... |
public void testDeleteLeftoverFiles() throws IOException {
MockDirectoryWrapper dir = newDirectory();
dir.setPreventDoubleWrite(false);
LogMergePolicy mergePolicy = newLogMergePolicy(true, 10);
mergePolicy.setNoCFSRatio(1); // This test expects all of its segments to be in CFS
IndexWriter writer... | public void testDeleteLeftoverFiles() throws IOException {
MockDirectoryWrapper dir = newDirectory();
dir.setPreventDoubleWrite(false);
LogMergePolicy mergePolicy = newLogMergePolicy(true, 10);
mergePolicy.setNoCFSRatio(1); // This test expects all of its segments to be in CFS
IndexWriter writer... |
public double apply(Wrapper x, double[] params) {
for (TrainingExample example : buffer) {
x.train(example);
}
if (x.getLearner().validModel()) {
if (x.getLearner().numCategories() == 2) {
return x.wrapped.auc();
} else {
... | public double apply(Wrapper x, double[] params) {
for (TrainingExample example : buffer) {
x.train(example);
}
if (x.getLearner().validModel()) {
if (x.getLearner().numCategories() == 2) {
return x.wrapped.auc();
} else {
... |
public static Test suite() {
TestSuite suite = new TestSuite("lang");
// DERBY-1315 and DERBY-1735 need to be addressed
// before re-enabling this test as it's memory use is
// different on different vms leading to failures in
// the nightly runs.
// suite.addTest(la... | public static Test suite() {
TestSuite suite = new TestSuite("lang");
// DERBY-1315 and DERBY-1735 need to be addressed
// before re-enabling this test as it's memory use is
// different on different vms leading to failures in
// the nightly runs.
// suite.addTest(la... |
private void pushDeletes(SegmentInfo newSegment, SegmentInfos segmentInfos) {
// Lock order: DW -> BD
final long delGen = bufferedDeletesStream.getNextGen();
if (pendingDeletes.any()) {
if (segmentInfos.size() > 0 || newSegment != null) {
final FrozenBufferedDeletes packet = new FrozenBuffer... | private void pushDeletes(SegmentInfo newSegment, SegmentInfos segmentInfos) {
// Lock order: DW -> BD
final long delGen = bufferedDeletesStream.getNextGen();
if (pendingDeletes.any()) {
if (segmentInfos.size() > 0 || newSegment != null) {
final FrozenBufferedDeletes packet = new FrozenBuffer... |
private EntityManager getPersistenceContext(boolean forceTransaction)
{
if (forceTransaction) {
return reg.getCurrentPersistenceContext(emf, props, instanceCount, callback);
} else {
if (reg.isTransactionActive()) {
return reg.getCurrentPersistenceContext(emf, props, instanceCount, call... | private EntityManager getPersistenceContext(boolean forceTransaction)
{
if (forceTransaction) {
return reg.getCurrentPersistenceContext(emf, props, instanceCount, callback);
} else {
if (reg.isTransactionActive()) {
return reg.getCurrentPersistenceContext(emf, props, instanceCount, call... |
public long computeNorm(FieldInvertState state) {
final float numTerms;
if (discountOverlaps)
numTerms = state.getLength() - state.getNumOverlap();
else
numTerms = state.getLength() / state.getBoost();
return encodeNormValue(state.getBoost(), numTerms);
}
| public long computeNorm(FieldInvertState state) {
final float numTerms;
if (discountOverlaps)
numTerms = state.getLength() - state.getNumOverlap();
else
numTerms = state.getLength();
return encodeNormValue(state.getBoost(), numTerms);
}
|
public static <T extends SpecificRecord> T deserializeWithSchema(ByteBuffer bytes, T ob) throws IOException
{
BinaryDecoder dec = DIRECT_DECODERS.createBinaryDecoder(bytes.array(),bytes.position()+bytes.arrayOffset(), bytes.remaining(), null);
Schema writer = Schema.parse(dec.readString(new Utf8... | public static <T extends SpecificRecord> T deserializeWithSchema(ByteBuffer bytes, T ob) throws IOException
{
BinaryDecoder dec = DIRECT_DECODERS.createBinaryDecoder(bytes.array(),bytes.position()+bytes.arrayOffset(), bytes.remaining(), null);
Schema writer = Schema.parse(dec.readString(new Utf8... |
public void testRunFinished(Result result) throws Exception {
if (printDiagnosticsAfterClass || LuceneTestCase.VERBOSE) {
RunListenerPrintReproduceInfo.printDebuggingInformation();
}
if (suiteFailed) {
reportAdditionalFailureInfo(null);
}
}
/** print some useful debugging informati... | public void testRunFinished(Result result) throws Exception {
if (printDiagnosticsAfterClass || LuceneTestCase.VERBOSE) {
RunListenerPrintReproduceInfo.printDebuggingInformation();
}
if (suiteFailed) {
reportAdditionalFailureInfo(null);
}
}
/** print some useful debugging informati... |
public void testSingleColumn() throws IOException
{
ColumnFamily cf;
cf = ColumnFamily.create("Keyspace1", "Standard1");
cf.addColumn(column("C", "v", 1));
DataOutputBuffer bufOut = new DataOutputBuffer();
ColumnFamily.serializer().serialize(cf, bufOut);
ByteArr... | public void testSingleColumn() throws IOException
{
ColumnFamily cf;
cf = ColumnFamily.create("Keyspace1", "Standard1");
cf.addColumn(column("C", "v", 1));
DataOutputBuffer bufOut = new DataOutputBuffer();
ColumnFamily.serializer().serialize(cf, bufOut);
ByteArr... |
public static ColumnFamilyStore writeColumnFamily(List<RowMutation> rms) throws IOException, ExecutionException, InterruptedException
{
RowMutation first = rms.get(0);
String tablename = first.getTable();
String cfname = first.columnFamilyNames().iterator().next();
Table table =... | public static ColumnFamilyStore writeColumnFamily(List<RowMutation> rms) throws IOException, ExecutionException, InterruptedException
{
RowMutation first = rms.get(0);
String tablename = first.getTable();
String cfname = first.getColumnFamilies().iterator().next().metadata().cfName;
... |
public void apply(RowMutation mutation, Object serializedMutation, boolean writeCommitLog) throws IOException
{
HashMap<ColumnFamilyStore,Memtable> memtablesToFlush = new HashMap<ColumnFamilyStore, Memtable>(2);
// write the mutation to the commitlog and memtables
flusherLock.readLock()... | public void apply(RowMutation mutation, Object serializedMutation, boolean writeCommitLog) throws IOException
{
HashMap<ColumnFamilyStore,Memtable> memtablesToFlush = new HashMap<ColumnFamilyStore, Memtable>(2);
// write the mutation to the commitlog and memtables
flusherLock.readLock()... |
public static final String VERSION = "15.0.0";
} | public static final String VERSION = "16.0.0";
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.