buggy_function stringlengths 1 391k | fixed_function stringlengths 0 392k |
|---|---|
private static final int DEFAULT_THRIFT_PORT = 9160;
// Register the command line options and their properties (such as
// whether they take an extra argument, etc.
static
{
options = new CLIOptions();
options.addOption("h", HOST_OPTION, "HOSTNAME", "cassandra server's host... | private static final int DEFAULT_THRIFT_PORT = 9160;
// Register the command line options and their properties (such as
// whether they take an extra argument, etc.
static
{
options = new CLIOptions();
options.addOption("h", HOST_OPTION, "HOSTNAME", "cassandra server's host... |
protected void slice_check()
{
if (bra < 0 ||
bra > ket ||
ket > limit)
{
System.err.println("faulty slice operation");
// FIXME: report error somehow.
/*
fprintf(stderr, "faulty slice operation:\n");
debug(z, -1, 0);
exit(1);
*/
}
}
| protected void slice_check()
{
if (bra < 0 ||
bra > ket ||
ket > limit)
{
throw new IllegalArgumentException("faulty slice operation: bra=" + bra + ",ket=" + ket + ",limit=" + limit);
// FIXME: report error somehow.
/*
fprintf(stderr, "faulty slice operation:\n");
debug(z, -1, 0);
... |
public static SchemaField getAndCheckVersionField(IndexSchema schema)
throws SolrException {
final String errPrefix = VERSION_FIELD + "field must exist in schema, using indexed=\"true\" stored=\"true\" and multiValued=\"false\"";
SchemaField sf = schema.getFieldOrNull(VERSION_FIELD);
if (null == sf)... | public static SchemaField getAndCheckVersionField(IndexSchema schema)
throws SolrException {
final String errPrefix = VERSION_FIELD + "field must exist in schema, using indexed=\"true\" stored=\"true\" and multiValued=\"false\"";
SchemaField sf = schema.getFieldOrNull(VERSION_FIELD);
if (null == sf)... |
public static int getColumnDisplaySize(int typeId, int storageLength)
{
int size;
switch (typeId)
{
case Types.TIMESTAMP:
size = 26;
break;
case Types.DATE:
size = 10;
break;
case Types.TIME:
size = 8;
break;
case Types.INTEGER:
size = 11;
break;
case Types.SMALLI... | public static int getColumnDisplaySize(int typeId, int storageLength)
{
int size;
switch (typeId)
{
case Types.TIMESTAMP:
size = 29;
break;
case Types.DATE:
size = 10;
break;
case Types.TIME:
size = 8;
break;
case Types.INTEGER:
size = 11;
break;
case Types.SMALLI... |
public void testExactFileNames() throws IOException {
String outputDir = "lucene.backwardscompat0.index";
rmDir(outputDir);
try {
Directory dir = FSDirectory.open(new File(fullDir(outputDir)));
IndexWriter writer = new IndexWriter(dir, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLen... | public void testExactFileNames() throws IOException {
String outputDir = "lucene.backwardscompat0.index";
rmDir(outputDir);
try {
Directory dir = FSDirectory.open(new File(fullDir(outputDir)));
IndexWriter writer = new IndexWriter(dir, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLen... |
private static Mutation getMutation(Text word, int sum)
{
Column c = new Column();
c.setName(Arrays.copyOf(word.getBytes(), word.getLength()));
c.setValue(ByteBufferUtil.bytes(String.valueOf(sum));
c.setTimestamp(System.currentTimeMillis());
M... | private static Mutation getMutation(Text word, int sum)
{
Column c = new Column();
c.setName(Arrays.copyOf(word.getBytes(), word.getLength()));
c.setValue(ByteBufferUtil.bytes(String.valueOf(sum)));
c.setTimestamp(System.currentTimeMillis());
... |
public Class[] getMethodParameterClasses()
{
ClassInspector ci = getClassFactory().getClassInspector();
Class[] parmTypeClasses = new Class[methodParms.length];
for (int i = 0; i < methodParms.length; i++)
{
String className = methodParameterTypes[i];
try
{
parmTypeClasses[i] = ci.getClass(cla... | public Class[] getMethodParameterClasses()
{
ClassInspector ci = getClassFactory().getClassInspector();
Class[] parmTypeClasses = new Class[methodParms.length];
for (int i = 0; i < methodParms.length; i++)
{
String className = methodParameterTypes[i];
try
{
parmTypeClasses[i] = ci.getClass(cla... |
private Metadata createTargetMetadata(boolean isPersistenceUnit,
ParserContext ctx, String unitName) {
// Create a service reference for the EMF (it is an EMF for persistence
// contexts and units)
final MutableReferenceMetadata refMetadata = (MutableReferenceMetadata) ctx
.c... | private Metadata createTargetMetadata(boolean isPersistenceUnit,
ParserContext ctx, String unitName) {
// Create a service reference for the EMF (it is an EMF for persistence
// contexts and units)
final MutableReferenceMetadata refMetadata = (MutableReferenceMetadata) ctx
.c... |
private void verifyEnum(ThreadState threadState,
String field,
BytesRef term,
TermsEnum termsEnum,
// Maximum options (docs/freqs/positions/offsets) to test:
IndexOptions maxIndexOptions,... | private void verifyEnum(ThreadState threadState,
String field,
BytesRef term,
TermsEnum termsEnum,
// Maximum options (docs/freqs/positions/offsets) to test:
IndexOptions maxIndexOptions,... |
public void process(ResponseBuilder rb) throws IOException {
SolrParams params = rb.req.getParams();
if (!params.getBool(TermsParams.TERMS, false)) return;
String[] fields = params.getParams(TermsParams.TERMS_FIELD);
NamedList termsResult = new SimpleOrderedMap();
rb.rsp.add("terms", termsResult... | public void process(ResponseBuilder rb) throws IOException {
SolrParams params = rb.req.getParams();
if (!params.getBool(TermsParams.TERMS, false)) return;
String[] fields = params.getParams(TermsParams.TERMS_FIELD);
NamedList termsResult = new SimpleOrderedMap();
rb.rsp.add("terms", termsResult... |
public static void purgeFieldCache(IndexReader r) throws IOException {
// this is just a hack, to get an atomic reader that contains all subreaders for insanity checks
FieldCache.DEFAULT.purge(SlowCompositeReaderWrapper.wrap(r));
}
| public static void purgeFieldCache(IndexReader r) throws IOException {
// this is just a hack, to get an atomic reader that contains all subreaders for insanity checks
FieldCache.DEFAULT.purgeByCacheKey(SlowCompositeReaderWrapper.wrap(r).getCoreCacheKey());
}
|
public void evaluate() throws Throwable {
if (NestedTestSuite.class.isAssignableFrom(d.getTestClass())) {
LuceneTestCase.assumeTrue("Nested suite class ignored (started as stand-along).",
isRunningNested());
}
s.evaluate();
}
};
}
| public void evaluate() throws Throwable {
if (NestedTestSuite.class.isAssignableFrom(d.getTestClass())) {
LuceneTestCase.assumeTrue("Nested suite class ignored (started as stand-alone).",
isRunningNested());
}
s.evaluate();
}
};
}
|
public synchronized void blockUntilFinished() {
lock = new CountDownLatch(1);
try {
// Wait until no runners are running
for (;;) {
Runner runner;
synchronized (runners) {
runner = runners.peek();
}
if (runner == null)
break;
runner.runne... | public synchronized void blockUntilFinished() {
lock = new CountDownLatch(1);
try {
// Wait until no runners are running
for (;;) {
Runner runner;
synchronized (runners) {
runner = runners.peek();
}
if (runner == null || scheduler.isTerminated())
... |
private static void runJob(String input,
String output,
String measureClassName,
double t1,
double t2,
double convergenceDelta,
int maxIteration... | private static void runJob(String input,
String output,
String measureClassName,
double t1,
double t2,
double convergenceDelta,
int maxIteration... |
private static void runTests(Properties suiteProps, String suite)
throws IOException, Exception
{
// save a copy of the system properties at this point; when runing with
// java threads we need to reset the system properties to this list;
// otherwise we start to accumulate extraneous pro... | private static void runTests(Properties suiteProps, String suite)
throws IOException, Exception
{
// save a copy of the system properties at this point; when runing with
// java threads we need to reset the system properties to this list;
// otherwise we start to accumulate extraneous pro... |
private int addCategoryDocument(CategoryPath categoryPath, int length,
int parent) throws IOException {
// Before Lucene 2.9, position increments >=0 were supported, so we
// added 1 to parent to allow the parent -1 (the parent of the root).
// Unfortunately, starting with Lucene 2.9, after LUCENE-1... | private int addCategoryDocument(CategoryPath categoryPath, int length,
int parent) throws IOException {
// Before Lucene 2.9, position increments >=0 were supported, so we
// added 1 to parent to allow the parent -1 (the parent of the root).
// Unfortunately, starting with Lucene 2.9, after LUCENE-1... |
public boolean incrementToken() throws IOException {
if (input.incrementToken()) {
payloadAttr.setPayload(new BytesRef(("pos: " + pos).getBytes()));
int posIncr;
if (i % 2 == 1) {
posIncr = 1;
} else {
posIncr = 0;
}
posIncrAttr.setPositionIncrement(posIncr);
... | public boolean incrementToken() throws IOException {
if (input.incrementToken()) {
payloadAttr.setPayload(new BytesRef(("pos: " + pos).getBytes()));
int posIncr;
if (pos == 0 || i % 2 == 1) {
posIncr = 1;
} else {
posIncr = 0;
}
posIncrAttr.setPositionIncrement(... |
private void insertRow(String key) throws IOException
{
RowMutation rm = new RowMutation("Keyspace1", key);
ColumnFamily cf = ColumnFamily.create("Keyspace1", "Standard1");
cf.addColumn(column("col1", "val1", 1L));
rm.add(cf);
rm.apply();
}
| private void insertRow(String key) throws IOException
{
RowMutation rm = new RowMutation("Keyspace1", key.getBytes());
ColumnFamily cf = ColumnFamily.create("Keyspace1", "Standard1");
cf.addColumn(column("col1", "val1", 1L));
rm.add(cf);
rm.apply();
}
|
public void testCleanup() throws IOException, ExecutionException, InterruptedException
{
assert CommitLog.instance().getSegmentCount() == 1;
CommitLog.setSegmentSize(1000);
Table table = Table.open("Keyspace1");
ColumnFamilyStore store1 = table.getColumnFamilyStore("Standard1");... | public void testCleanup() throws IOException, ExecutionException, InterruptedException
{
assert CommitLog.instance().getSegmentCount() == 1;
CommitLog.setSegmentSize(1000);
Table table = Table.open("Keyspace1");
ColumnFamilyStore store1 = table.getColumnFamilyStore("Standard1");... |
public void testTokenGetsUpdated() throws IOException
{
SystemTable.StorageMetadata storageMetadata1 = SystemTable.initMetadata();
SystemTable.updateToken(StorageService.getPartitioner().getToken("503545744:0"));
SystemTable.StorageMetadata storageMetadata2 = SystemTable.initMetadata();
... | public void testTokenGetsUpdated() throws IOException
{
SystemTable.StorageMetadata storageMetadata1 = SystemTable.initMetadata();
SystemTable.updateToken(StorageService.getPartitioner().getToken("503545744:0".getBytes()));
SystemTable.StorageMetadata storageMetadata2 = SystemTable.initM... |
public void testStringEndpoints() throws UnknownHostException
{
TokenMetadata tmd = new TokenMetadata();
IPartitioner partitioner = new OrderPreservingPartitioner();
AbstractReplicationStrategy strategy = new RackUnawareStrategy(tmd, null);
List<Token> endPointTokens = new Array... | public void testStringEndpoints() throws UnknownHostException
{
TokenMetadata tmd = new TokenMetadata();
IPartitioner partitioner = new OrderPreservingPartitioner();
AbstractReplicationStrategy strategy = new RackUnawareStrategy(tmd, null);
List<Token> endPointTokens = new Array... |
public void testTransferTable() throws Exception
{
StorageService.instance.initServer();
// write a temporary SSTable, but don't register it
Set<String> content = new HashSet<String>();
content.add("key");
SSTableReader sstable = SSTableUtils.writeSSTable(content);
... | public void testTransferTable() throws Exception
{
StorageService.instance.initServer();
// write a temporary SSTable, but don't register it
Set<String> content = new HashSet<String>();
content.add("key");
SSTableReader sstable = SSTableUtils.writeSSTable(content);
... |
public static void main(String[] args) throws Throwable
{
int minRow;
int maxRow;
String rowPrefix, keyspace = "Keyspace1";
if (args.length > 0)
{
keyspace = args[0];
rowPrefix = args[1];
minRow = Integer.parseInt(args[2]);
... | public static void main(String[] args) throws Throwable
{
int minRow;
int maxRow;
String rowPrefix, keyspace = "Keyspace1";
if (args.length > 0)
{
keyspace = args[0];
rowPrefix = args[1];
minRow = Integer.parseInt(args[2]);
... |
public void doVerb(Message message)
{
byte[] bytes = message.getMessageBody();
ByteArrayInputStream buffer = new ByteArrayInputStream(bytes);
try
{
RowMutation rm = RowMutation.serializer().deserialize(new DataInputStream(buffer));
if (logger_.isDebugEnab... | public void doVerb(Message message)
{
byte[] bytes = message.getMessageBody();
ByteArrayInputStream buffer = new ByteArrayInputStream(bytes);
try
{
RowMutation rm = RowMutation.serializer().deserialize(new DataInputStream(buffer));
if (logger_.isDebugEnab... |
public List<InetAddress> getEndPoint(String key)
{
if (tokenMetadata == null)
throw new RuntimeException("Must refresh endpoints before looking up a key.");
AbstractReplicationStrategy strat = StorageService.getReplicationStrategy(tokenMetadata, keyspace);
return strat.getNat... | public List<InetAddress> getEndPoint(byte[] key)
{
if (tokenMetadata == null)
throw new RuntimeException("Must refresh endpoints before looking up a key.");
AbstractReplicationStrategy strat = StorageService.getReplicationStrategy(tokenMetadata, keyspace);
return strat.getNat... |
public static JobConf buildJobConf(String recommendClassName,
int recommendationsPerUser,
String userIDFile,
String dataModelFile,
String outputPath) throws IOException {... | public static JobConf buildJobConf(String recommendClassName,
int recommendationsPerUser,
String userIDFile,
String dataModelFile,
String outputPath) throws IOException {... |
public static JobConf buildJobConf(String prefsFile,
String outputPath) throws IOException {
Path prefsFilePath = new Path(prefsFile);
Path outputPathPath = new Path(outputPath);
JobConf jobConf = new JobConf(SlopeOnePrefsToDiffsJob.class);
FileSystem fs = FileS... | public static JobConf buildJobConf(String prefsFile,
String outputPath) throws IOException {
Path prefsFilePath = new Path(prefsFile);
Path outputPathPath = new Path(outputPath);
JobConf jobConf = new JobConf(SlopeOnePrefsToDiffsJob.class);
FileSystem fs = FileS... |
public static JobConf buildJobConf(String prefsFile,
String outputPath) throws IOException {
Path prefsFilePath = new Path(prefsFile);
Path outputPathPath = new Path(outputPath);
JobConf jobConf = new JobConf(SlopeOnePrefsToDiffsJob.class);
FileSystem fs = FileS... | public static JobConf buildJobConf(String prefsFile,
String outputPath) throws IOException {
Path prefsFilePath = new Path(prefsFile);
Path outputPathPath = new Path(outputPath);
JobConf jobConf = new JobConf(SlopeOnePrefsToDiffsJob.class);
FileSystem fs = FileS... |
public static void runJob(String input, String output, String modelFactory,
int numModels, int maxIterations, double alpha_0)
throws IOException, ClassNotFoundException, InstantiationException,
IllegalAccessException {
// delete the output directory
JobConf conf = new JobConf(DirichletJob.cl... | public static void runJob(String input, String output, String modelFactory,
int numModels, int maxIterations, double alpha_0)
throws IOException, ClassNotFoundException, InstantiationException,
IllegalAccessException {
// delete the output directory
JobConf conf = new JobConf(DirichletJob.cl... |
public static void runJob(String points, String canopies, String output,
String measureClassName, double t1, double t2) throws IOException {
JobClient client = new JobClient();
JobConf conf = new JobConf(
org.apache.mahout.clustering.canopy.ClusterDriver.class);
co... | public static void runJob(String points, String canopies, String output,
String measureClassName, double t1, double t2) throws IOException {
JobClient client = new JobClient();
JobConf conf = new JobConf(
org.apache.mahout.clustering.canopy.ClusterDriver.class);
co... |
public static void runJob(String input, String output,
String measureClassName, double t1, double t2) throws IOException {
JobClient client = new JobClient();
JobConf conf = new JobConf(
org.apache.mahout.clustering.canopy.CanopyDriver.class);
conf.set(Canopy.DISTAN... | public static void runJob(String input, String output,
String measureClassName, double t1, double t2) throws IOException {
JobClient client = new JobClient();
JobConf conf = new JobConf(
org.apache.mahout.clustering.canopy.CanopyDriver.class);
conf.set(Canopy.DISTAN... |
public static void runJob(String input, String clustersIn, String output,
String measureClass, double convergenceDelta, int maxIterations,
int numCentroids) throws IOException {
// delete the output directory
JobConf conf = new JobConf(KMeansJob.class);
Path outPath = new Path(output);
Fil... | public static void runJob(String input, String clustersIn, String output,
String measureClass, double convergenceDelta, int maxIterations,
int numCentroids) throws IOException {
// delete the output directory
JobConf conf = new JobConf(KMeansJob.class);
Path outPath = new Path(output);
Fil... |
private static boolean runIteration(String input, String clustersIn,
String clustersOut, String measureClass, String convergenceDelta,
int numReduceTasks) {
JobClient client = new JobClient();
JobConf conf = new JobConf(KMeansDriver.class);
conf.setOutputKeyClass(Text.class);
conf.setOutpu... | private static boolean runIteration(String input, String clustersIn,
String clustersOut, String measureClass, String convergenceDelta,
int numReduceTasks) {
JobClient client = new JobClient();
JobConf conf = new JobConf(KMeansDriver.class);
conf.setOutputKeyClass(Text.class);
conf.setOutpu... |
public static void runJob(String input, String output,
String measureClassName, double t1, double t2, double convergenceDelta,
int maxIterations) throws IOException {
// delete the output directory
JobConf conf = new JobConf(MeanShiftCanopyDriver.class);
Path outPath = new Path(output);
Fi... | public static void runJob(String input, String output,
String measureClassName, double t1, double t2, double convergenceDelta,
int maxIterations) throws IOException {
// delete the output directory
JobConf conf = new JobConf(MeanShiftCanopyDriver.class);
Path outPath = new Path(output);
Fi... |
private static boolean runIteration(String input, String clustersIn,
String clustersOut, String measureClass, String convergenceDelta,
int numMapTasks, int numReduceTasks, int iterationNumber, float m) {
JobConf conf = new JobConf(FuzzyKMeansJob.class);
conf.setJobName("Fuzzy K Means{" + iteratio... | private static boolean runIteration(String input, String clustersIn,
String clustersOut, String measureClass, String convergenceDelta,
int numMapTasks, int numReduceTasks, int iterationNumber, float m) {
JobConf conf = new JobConf(FuzzyKMeansJob.class);
conf.setJobName("Fuzzy K Means{" + iteratio... |
public void configure(JobConf jobConf) {
if (parameters == null) {
ParameteredGeneralizations.configureParameters(this, jobConf);
}
try {
FileSystem fs = FileSystem.get(jobConf);
if (weightsFile.get() != null) {
Vector weights = (Vector) vectorClass.get().newInstance();
i... | public void configure(JobConf jobConf) {
if (parameters == null) {
ParameteredGeneralizations.configureParameters(this, jobConf);
}
try {
FileSystem fs = FileSystem.get(weightsFile.get().toUri(), jobConf);
if (weightsFile.get() != null) {
Vector weights = (Vector) vectorClass.get... |
public static void runJob(String input, String output) throws IOException {
JobClient client = new JobClient();
JobConf conf = new JobConf(BayesThetaNormalizerDriver.class);
conf.setOutputKeyClass(Text.class);
conf.setOutputValueClass(DoubleWritable.class);
FileInputFormat.addInputPath(conf,... | public static void runJob(String input, String output) throws IOException {
JobClient client = new JobClient();
JobConf conf = new JobConf(BayesThetaNormalizerDriver.class);
conf.setOutputKeyClass(Text.class);
conf.setOutputValueClass(DoubleWritable.class);
FileInputFormat.addInputPath(conf,... |
public static void runJob(String input, String output, int gramSize) throws IOException {
JobClient client = new JobClient();
JobConf conf = new JobConf(BayesFeatureDriver.class);
conf.setOutputKeyClass(Text.class);
conf.setOutputValueClass(DoubleWritable.class);
FileInputFormat.setInputPaths(co... | public static void runJob(String input, String output, int gramSize) throws IOException {
JobClient client = new JobClient();
JobConf conf = new JobConf(BayesFeatureDriver.class);
conf.setOutputKeyClass(Text.class);
conf.setOutputValueClass(DoubleWritable.class);
FileInputFormat.setInputPaths(co... |
public static void runJob(String input, String output) throws IOException {
JobClient client = new JobClient();
JobConf conf = new JobConf(BayesTfIdfDriver.class);
conf.setOutputKeyClass(Text.class);
conf.setOutputValueClass(DoubleWritable.class);
FileInputFormat.addInputPath(conf, new Path... | public static void runJob(String input, String output) throws IOException {
JobClient client = new JobClient();
JobConf conf = new JobConf(BayesTfIdfDriver.class);
conf.setOutputKeyClass(Text.class);
conf.setOutputValueClass(DoubleWritable.class);
FileInputFormat.addInputPath(conf, new Path... |
public static void runJob(String input, String output) throws IOException {
JobClient client = new JobClient();
JobConf conf = new JobConf(BayesWeightSummerDriver.class);
conf.setOutputKeyClass(Text.class);
conf.setOutputValueClass(DoubleWritable.class);
FileInputFormat.addInputPath(conf, n... | public static void runJob(String input, String output) throws IOException {
JobClient client = new JobClient();
JobConf conf = new JobConf(BayesWeightSummerDriver.class);
conf.setOutputKeyClass(Text.class);
conf.setOutputValueClass(DoubleWritable.class);
FileInputFormat.addInputPath(conf, n... |
public static void runJob(String input, String output) throws IOException {
JobClient client = new JobClient();
JobConf conf = new JobConf(CBayesThetaDriver.class);
conf.setOutputKeyClass(Text.class);
conf.setOutputValueClass(DoubleWritable.class);
FileInputFormat.addInputPath(conf, new Pat... | public static void runJob(String input, String output) throws IOException {
JobClient client = new JobClient();
JobConf conf = new JobConf(CBayesThetaDriver.class);
conf.setOutputKeyClass(Text.class);
conf.setOutputValueClass(DoubleWritable.class);
FileInputFormat.addInputPath(conf, new Pat... |
public static void runJob(String input, String output) throws IOException {
JobClient client = new JobClient();
JobConf conf = new JobConf(CBayesThetaNormalizerDriver.class);
conf.setOutputKeyClass(Text.class);
conf.setOutputValueClass(DoubleWritable.class);
FileInputFormat.addInputPath(conf... | public static void runJob(String input, String output) throws IOException {
JobClient client = new JobClient();
JobConf conf = new JobConf(CBayesThetaNormalizerDriver.class);
conf.setOutputKeyClass(Text.class);
conf.setOutputValueClass(DoubleWritable.class);
FileInputFormat.addInputPath(conf... |
public static void runJob(String input, String output) throws IOException {
JobClient client = new JobClient();
JobConf conf = new JobConf(CBayesNormalizedWeightDriver.class);
conf.setOutputKeyClass(Text.class);
conf.setOutputValueClass(DoubleWritable.class);
FileInputFormat.addInputPath(con... | public static void runJob(String input, String output) throws IOException {
JobClient client = new JobClient();
JobConf conf = new JobConf(CBayesNormalizedWeightDriver.class);
conf.setOutputKeyClass(Text.class);
conf.setOutputValueClass(DoubleWritable.class);
FileInputFormat.addInputPath(con... |
public static void main(String[] args)
throws IOException, ClassNotFoundException, IllegalAccessException, InstantiationException, OptionException {
DefaultOptionBuilder obuilder = new DefaultOptionBuilder();
ArgumentBuilder abuilder = new ArgumentBuilder();
GroupBuilder gbuilder = new GroupBuil... | public static void main(String[] args)
throws IOException, ClassNotFoundException, IllegalAccessException, InstantiationException, OptionException {
DefaultOptionBuilder obuilder = new DefaultOptionBuilder();
ArgumentBuilder abuilder = new ArgumentBuilder();
GroupBuilder gbuilder = new GroupBuil... |
private static void runJob(String input, String output,
String measureClassName, double t1, double t2) throws IOException {
JobClient client = new JobClient();
JobConf conf = new JobConf(Job.class);
Path outPath = new Path(output);
client.setConf(conf);
FileSystem dfs = FileSystem.get(conf)... | private static void runJob(String input, String output,
String measureClassName, double t1, double t2) throws IOException {
JobClient client = new JobClient();
JobConf conf = new JobConf(Job.class);
Path outPath = new Path(output);
client.setConf(conf);
FileSystem dfs = FileSystem.get(outPa... |
private static void runJob(String input, String output,
String measureClassName, double t1, double t2, double convergenceDelta,
int maxIterations) throws IOException {
JobClient client = new JobClient();
JobConf conf = new JobConf(Job.class);
Path outPath = new Path(output);
client.setCon... | private static void runJob(String input, String output,
String measureClassName, double t1, double t2, double convergenceDelta,
int maxIterations) throws IOException {
JobClient client = new JobClient();
JobConf conf = new JobConf(Job.class);
Path outPath = new Path(output);
client.setCon... |
public static void runJob(String input, String output, String modelFactory,
int numModels, int maxIterations, double alpha_0, int numReducers)
throws IOException, ClassNotFoundException, InstantiationException,
IllegalAccessException {
// delete the output directory
JobConf conf = new JobCon... | public static void runJob(String input, String output, String modelFactory,
int numModels, int maxIterations, double alpha_0, int numReducers)
throws IOException, ClassNotFoundException, InstantiationException,
IllegalAccessException {
// delete the output directory
JobConf conf = new JobCon... |
public static void main(String[] args) throws IOException,
OptionException {
DefaultOptionBuilder obuilder = new DefaultOptionBuilder();
ArgumentBuilder abuilder = new ArgumentBuilder();
GroupBuilder gbuilder = new GroupBuilder();
Option pathOpt = obuilder.withLongName("path").withRequired(true... | public static void main(String[] args) throws IOException,
OptionException {
DefaultOptionBuilder obuilder = new DefaultOptionBuilder();
ArgumentBuilder abuilder = new ArgumentBuilder();
GroupBuilder gbuilder = new GroupBuilder();
Option pathOpt = obuilder.withLongName("path").withRequired(true... |
public static void runJob(String input, String output, String countriesFile) throws IOException {
JobClient client = new JobClient();
JobConf conf = new JobConf(WikipediaDatasetCreatorDriver.class);
conf.set("key.value.separator.in.input.line", " ");
conf.set("xmlinput.start", "<text xml:space=\"pres... | public static void runJob(String input, String output, String countriesFile) throws IOException {
JobClient client = new JobClient();
JobConf conf = new JobConf(WikipediaDatasetCreatorDriver.class);
conf.set("key.value.separator.in.input.line", " ");
conf.set("xmlinput.start", "<text xml:space=\"pres... |
private float freq; //phrase frequency in current doc as computed by phraseFreq().
PhraseScorer(Weight weight, PhraseQuery.PostingsAndFreq[] postings,
Similarity similarity, byte[] norms) {
super(similarity, weight);
this.norms = norms;
this.value = weight.getValue();
// convert tps to a lis... | private float freq; //phrase frequency in current doc as computed by phraseFreq().
PhraseScorer(Weight weight, PhraseQuery.PostingsAndFreq[] postings,
Similarity similarity, byte[] norms) {
super(similarity, weight);
this.norms = norms;
this.value = weight.getValue();
// convert tps to a lis... |
public void testNegativePositions() throws Exception {
File oldIndexDir = _TestUtil.getTempDir("negatives");
_TestUtil.unzip(getDataFile(bogus24IndexName), oldIndexDir);
Directory dir = newFSDirectory(oldIndexDir);
DirectoryReader ir = DirectoryReader.open(dir);
IndexSearcher is = new IndexSearche... | public void testNegativePositions() throws Exception {
File oldIndexDir = _TestUtil.getTempDir("negatives");
_TestUtil.unzip(getDataFile(bogus24IndexName), oldIndexDir);
Directory dir = newFSDirectory(oldIndexDir);
DirectoryReader ir = DirectoryReader.open(dir);
IndexSearcher is = new IndexSearche... |
protected void setup(Context context) throws IOException, InterruptedException {
super.setup(context);
Parameters params = new Parameters(context.getConfiguration().get(PFPGrowth.PFP_PARAMETERS, ""));
int i = 0;
for (Pair<String,Long> e : PFPGrowth.deserializeList(params, PFPGrowth.F_LIST, contex... | protected void setup(Context context) throws IOException, InterruptedException {
super.setup(context);
Parameters params = new Parameters(context.getConfiguration().get(PFPGrowth.PFP_PARAMETERS, ""));
int i = 0;
for (Pair<String,Long> e : PFPGrowth.readFList(context.getConfiguration())) {
f... |
public static void main(String[] args) throws IOException {
DefaultOptionBuilder obuilder = new DefaultOptionBuilder();
ArgumentBuilder abuilder = new ArgumentBuilder();
GroupBuilder gbuilder = new GroupBuilder();
Option inputOpt = obuilder.withLongName("dir").withRequired(true).withArgument(
... | public static void main(String[] args) throws IOException {
DefaultOptionBuilder obuilder = new DefaultOptionBuilder();
ArgumentBuilder abuilder = new ArgumentBuilder();
GroupBuilder gbuilder = new GroupBuilder();
Option inputOpt = obuilder.withLongName("dir").withRequired(true).withArgument(
... |
public void test_errorcode() throws Exception
{
ResultSet rs = null;
Statement s = createStatement();
s.executeUpdate(
"create table t(i int, s smallint)");
s.executeUpdate(
"insert into t values (1,2)");
s.executeUpdate("insert i... | public void test_errorcode() throws Exception
{
ResultSet rs = null;
Statement s = createStatement();
s.executeUpdate(
"create table t(i int, s smallint)");
s.executeUpdate(
"insert into t values (1,2)");
s.executeUpdate("insert i... |
public void testContextSensitiveCollate() throws Exception {
// DirectSolrSpellChecker IndexBasedSpellChecker
String[] dictionary = {"direct", "default_teststop" };
for(int i=0 ; i<1 ; i++) {
assertQ(
req(
"q", "teststop:(flew AND form AND heath... | public void testContextSensitiveCollate() throws Exception {
// DirectSolrSpellChecker IndexBasedSpellChecker
String[] dictionary = {"direct", "default_teststop" };
for(int i=0 ; i<=1 ; i++) {
assertQ(
req(
"q", "teststop:(flew AND form AND heat... |
public void testRecoverAndOpen() throws IOException, ExecutionException, InterruptedException
{
// add data via the usual write path
RowMutation rm = new RowMutation("Keyspace1", ByteBufferUtil.bytes("k1"));
rm.add(new QueryPath("Indexed1", null, ByteBufferUtil.bytes("birthdate")), ByteB... | public void testRecoverAndOpen() throws IOException, ExecutionException, InterruptedException
{
// add data via the usual write path
RowMutation rm = new RowMutation("Keyspace1", ByteBufferUtil.bytes("k1"));
rm.add(new QueryPath("Indexed1", null, ByteBufferUtil.bytes("birthdate")), ByteB... |
public void testClientSpecificProviderLoadArgument() throws Exception {
Dictionary<String, String> headers = new Hashtable<String, String>();
headers.put(SpiFlyConstants.SPI_CONSUMER_HEADER,
"java.util.ServiceLoader#load(java.lang.Class[org.apache.aries.mytest.MySPI])," +
... | public void testClientSpecificProviderLoadArgument() throws Exception {
Dictionary<String, String> headers = new Hashtable<String, String>();
headers.put(SpiFlyConstants.SPI_CONSUMER_HEADER,
"java.util.ServiceLoader#load(java.lang.Class[org.apache.aries.mytest.MySPI])," +
... |
public void add( int startOffset, int endOffset, List<WeightedPhraseInfo> phraseInfoList ) {
float totalBoost = 0;
List<SubInfo> subInfos = new ArrayList<SubInfo>();
for( WeightedPhraseInfo phraseInfo : phraseInfoList ){
subInfos.add( new SubInfo( phraseInfo.getText(), phraseInfo.getTermsOffsets(), ... | public void add( int startOffset, int endOffset, List<WeightedPhraseInfo> phraseInfoList ) {
float totalBoost = 0;
List<SubInfo> subInfos = new ArrayList<SubInfo>();
for( WeightedPhraseInfo phraseInfo : phraseInfoList ){
subInfos.add( new SubInfo( phraseInfo.getText(), phraseInfo.getTermsOffsets(), ... |
public void freeSection(Section section, int resultSetHoldability) {
if (resultSetHoldability == JDBC30Translation.HOLD_CURSORS_OVER_COMMIT) {
this.freeSectionsHold_.push(section);
} else if (resultSetHoldability == JDBC30Translation.CLOSE_CURSORS_AT_COMMIT) {
this.freeSectio... | public void freeSection(Section section, int resultSetHoldability) {
if (resultSetHoldability == JDBC30Translation.HOLD_CURSORS_OVER_COMMIT) {
this.freeSectionsHold_.push(section);
} else if (resultSetHoldability == JDBC30Translation.CLOSE_CURSORS_AT_COMMIT) {
this.freeSectio... |
public void _testMultipleThreadsFailure(MockDirectoryWrapper.Failure failure) throws Exception {
int NUM_THREADS = 3;
for(int iter=0;iter<2;iter++) {
if (VERBOSE) {
System.out.println("TEST: iter=" + iter);
}
MockDirectoryWrapper dir = newMockDirectory();
IndexWriter writer ... | public void _testMultipleThreadsFailure(MockDirectoryWrapper.Failure failure) throws Exception {
int NUM_THREADS = 3;
for(int iter=0;iter<2;iter++) {
if (VERBOSE) {
System.out.println("TEST: iter=" + iter);
}
MockDirectoryWrapper dir = newMockDirectory();
IndexWriter writer ... |
public void configure(JobConf job) {
this.jobconf = job;
String cassConfig;
// Get the cached files
try
{
localFiles = DistributedCache.getLocalCacheFiles(job);
}
catch (IOException e)
{
... | public void configure(JobConf job) {
this.jobconf = job;
String cassConfig;
// Get the cached files
try
{
localFiles = DistributedCache.getLocalCacheFiles(job);
}
catch (IOException e)
{
... |
public int hashCode() {
return getDirectory().hashCode() + getSegmentsFileName().hashCode();
}
| public int hashCode() {
return (int) (getDirectory().hashCode() + getVersion());
}
|
private void executeGetWithConditions(Tree statement)
{
if (!CliMain.isConnected() || !hasKeySpace())
return;
IndexClause clause = new IndexClause();
String columnFamily = statement.getChild(0).getText();
// ^(CONDITIONS ^(CONDITION $column $value) ...)
Tree ... | private void executeGetWithConditions(Tree statement)
{
if (!CliMain.isConnected() || !hasKeySpace())
return;
IndexClause clause = new IndexClause();
String columnFamily = CliCompiler.getColumnFamily(statement, keyspacesMap.get(keySpace).cf_defs);
// ^(CONDITIONS ^(C... |
public final static String[] dncCompatibleJREVersions =
{"1.4", "1.5", "1.6"};
| public final static String[] dncCompatibleJREVersions =
{"1.5", "1.6", "1.7"};
|
public void testDocsAndPositionsEnum() throws Exception {
TermsEnum termsEnum = reader.terms(DOC_POSITIONS_FIELD).iterator(null);
assertEquals(SeekStatus.FOUND, termsEnum.seekCeil(new BytesRef(DOC_POSITIONS_TERM)));
DocsAndPositionsEnum sortedPositions = termsEnum.docsAndPositions(null, null);
int doc... | public void testDocsAndPositionsEnum() throws Exception {
TermsEnum termsEnum = reader.terms(DOC_POSITIONS_FIELD).iterator(null);
assertEquals(SeekStatus.FOUND, termsEnum.seekCeil(new BytesRef(DOC_POSITIONS_TERM)));
DocsAndPositionsEnum sortedPositions = termsEnum.docsAndPositions(null, null);
int doc... |
private void finishBootstrapping()
{
isBootstrapMode = false;
SystemTable.setBootstrapped(true);
setToken(getLocalToken());
Gossiper.instance().addApplicationState(StorageService.STATE_NORMAL, new ApplicationState(partitioner_.getTokenFactory().toString(getLocalToken())));
... | private void finishBootstrapping()
{
isBootstrapMode = false;
SystemTable.setBootstrapped(true);
setToken(getLocalToken());
Gossiper.instance().addApplicationState(StorageService.STATE_NORMAL, new ApplicationState(partitioner_.getTokenFactory().toString(getLocalToken())));
... |
public void testComputeSplit() throws Exception {
int n = 100;
IgSplit ref = new DefaultIgSplit();
IgSplit opt = new OptIgSplit();
Random rng = RandomUtils.getRandom();
Data data = Utils.randomData(rng, nbAttributes, numInstances);
for (int nloop = 0; nloop < n; nloop++) {
int attr = ... | public void testComputeSplit() throws Exception {
int n = 100;
IgSplit ref = new DefaultIgSplit();
IgSplit opt = new OptIgSplit();
Random rng = RandomUtils.getRandom();
Data data = Utils.randomData(rng, nbAttributes, numInstances);
for (int nloop = 0; nloop < n; nloop++) {
int attr = ... |
public Similarity getSimilarity() {
return (Similarity) obj;
}
};
}
if (similarityFactory instanceof SchemaAware){
schemaAware.add((SchemaAware) similarityFactory);
}
log.debug("using similarity factory" + similarityFactory.getClass().getName());
... | public Similarity getSimilarity() {
return (Similarity) obj;
}
};
}
if (similarityFactory instanceof SchemaAware){
schemaAware.add((SchemaAware) similarityFactory);
}
log.debug("using similarity factory" + similarityFactory.getClass().getName());
... |
public static String escape(String s) {
StringBuffer sb = new StringBuffer();
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
// These characters are part of the query syntax and must be escaped
if (c == '\\' || c == '+' || c == '-' || c == '!' || c == '(' || c == ')' || c == ':... | public static String escape(String s) {
StringBuffer sb = new StringBuffer();
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
// These characters are part of the query syntax and must be escaped
if (c == '\\' || c == '+' || c == '-' || c == '!' || c == '(' || c == ')' || c == ':... |
public void testIntFieldCache() throws IOException {
Directory dir = newDirectory();
IndexWriterConfig cfg = newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random()));
cfg.setMergePolicy(newLogMergePolicy());
RandomIndexWriter iw = new RandomIndexWriter(random(), dir);
Document doc = ... | public void testIntFieldCache() throws IOException {
Directory dir = newDirectory();
IndexWriterConfig cfg = newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random()));
cfg.setMergePolicy(newLogMergePolicy());
RandomIndexWriter iw = new RandomIndexWriter(random(), dir, cfg);
Document d... |
private void doSlice(String keyspace, String key, String columnFamily, byte[] superColumnName)
throws InvalidRequestException, UnavailableException, TimedOutException, TException, UnsupportedEncodingException
{
SliceRange range = new SliceRange(ArrayUtils.EMPTY_BYTE_ARRAY, ArrayUtils.EMPTY_BYTE_ARRA... | private void doSlice(String keyspace, String key, String columnFamily, byte[] superColumnName)
throws InvalidRequestException, UnavailableException, TimedOutException, TException, UnsupportedEncodingException
{
SliceRange range = new SliceRange(ArrayUtils.EMPTY_BYTE_ARRAY, ArrayUtils.EMPTY_BYTE_ARRA... |
public String getName()
{
return "function("+name+")";
}
| public String getName()
{
return name;
}
|
public IdentityQueryFilter()
{
super(ArrayUtils.EMPTY_BYTE_ARRAY, ArrayUtils.EMPTY_BYTE_ARRAY, null, false, Integer.MAX_VALUE);
}
| public IdentityQueryFilter()
{
super(ArrayUtils.EMPTY_BYTE_ARRAY, ArrayUtils.EMPTY_BYTE_ARRAY, false, Integer.MAX_VALUE);
}
|
public static final String VERSION = "8.5.0";
} | public static final String VERSION = "9.0.0";
} |
public synchronized IndexOutput createOutput(String name) throws IOException {
if (crashed)
throw new IOException("cannot createOutput after crash");
init();
if (preventDoubleWrite && createdFiles.contains(name) && !name.equals("segments.gen"))
throw new IOException("file \"" + name + "\" was ... | public synchronized IndexOutput createOutput(String name) throws IOException {
if (crashed)
throw new IOException("cannot createOutput after crash");
init();
if (preventDoubleWrite && createdFiles.contains(name) && !name.equals("segments.gen"))
throw new IOException("file \"" + name + "\" was ... |
private long lastModified = System.currentTimeMillis();
// File used as buffer, in no RAMDirectory
RAMFile() {}
RAMFile(RAMDirectory directory) {
this.directory = directory;
}
// For non-stream access from thread that might be concurrent with writing
synchronized long getLength() {
return len... | private long lastModified = System.currentTimeMillis();
// File used as buffer, in no RAMDirectory
RAMFile() {}
RAMFile(RAMDirectory directory) {
this.directory = directory;
}
// For non-stream access from thread that might be concurrent with writing
synchronized long getLength() {
return len... |
String LOCK_TIMEOUT_LOG = "40XL1.T.1";
/*
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 information regarding copyright owner... | String LOCK_TIMEOUT_LOG = "40XL1.T.1";
/*
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 information regarding copyright owner... |
public void reached(CompatibilitySpace compatibilitySpace, Object group,
int limit, Enumeration lockList, int lockCount)
throws StandardException {
// Count row locks by table
Dictionary containers = new java.util.Hashtable();
for (; lockList.hasMoreElements(); ) {
Object plainLock = lockList.nextE... | public void reached(CompatibilitySpace compatibilitySpace, Object group,
int limit, Enumeration lockList, int lockCount)
throws StandardException {
// Count row locks by table
Dictionary containers = new java.util.Hashtable();
for (; lockList.hasMoreElements(); ) {
Object plainLock = lockList.nextE... |
private static ContainerHandle openContainerNW(Transaction tran,
LockingPolicy rlock, ContainerKey containerId)
throws StandardException
{
ContainerHandle containerHdl = null;
try {
containerHdl = tran.openContainer
(containerId, rlock,
ContainerHandle.MODE_FORUPDATE |
ContainerHandle.MODE... | private static ContainerHandle openContainerNW(Transaction tran,
LockingPolicy rlock, ContainerKey containerId)
throws StandardException
{
ContainerHandle containerHdl = null;
try {
containerHdl = tran.openContainer
(containerId, rlock,
ContainerHandle.MODE_FORUPDATE |
ContainerHandle.MODE... |
public void cleanupOnError(Throwable t) {
if (t instanceof StandardException) {
StandardException se = (StandardException) t;
if (se.getSeverity() >= ExceptionSeverity.SESSION_SEVERITY) {
popMe();
return;
}
if (se.getSeverity() == Exceptio... | public void cleanupOnError(Throwable t) {
if (t instanceof StandardException) {
StandardException se = (StandardException) t;
if (se.getSeverity() >= ExceptionSeverity.SESSION_SEVERITY) {
popMe();
return;
}
if (se.getSeverity() == Exceptio... |
public String toString(String field)
{
float boost = getBoost();
return (boost!=1.0?"(":"") + func.toString()
+ (getBoost()==0 ? "" : ")^"+getBoost());
}
| public String toString(String field)
{
float boost = getBoost();
return (boost!=1.0?"(":"") + func.toString()
+ (boost==1.0 ? "" : ")^"+boost);
}
|
public static final String TIME_ELAPSED = "Time Elapsed";
static String getTimeElapsedSince(long l) {
l = System.currentTimeMillis() - l;
return (l / (60000 * 60)) % 60 + ":" + (l / 60000) % 60 + ":" + (l / 1000)
% 60 + "." + l % 1000;
}
| public static final String TIME_ELAPSED = "Time Elapsed";
static String getTimeElapsedSince(long l) {
l = System.currentTimeMillis() - l;
return (l / (60000 * 60)) + ":" + (l / 60000) % 60 + ":" + (l / 1000)
% 60 + "." + l % 1000;
}
|
public static SSTableReader open(String dataFileName, IPartitioner partitioner, double cacheFraction) throws IOException
{
assert partitioner != null;
assert openedFiles.get(dataFileName) == null;
long start = System.currentTimeMillis();
SSTableReader sstable = new SSTableReader... | public static SSTableReader open(String dataFileName, IPartitioner partitioner, double cacheFraction) throws IOException
{
assert partitioner != null;
assert openedFiles.get(dataFileName) == null;
long start = System.currentTimeMillis();
SSTableReader sstable = new SSTableReader... |
public static final String VERSION = "8.1.0";
} | public static final String VERSION = "8.2.0";
} |
public void setConf(Configuration conf) {
super.setConf(conf);
// If running in an Oozie workflow as a Java action, need to add the
// Configuration resource provided by Oozie to this job's config.
String oozieActionConfXml = System.getProperty("oozie.action.conf.xml");
if (oozieActionConfX... | public void setConf(Configuration conf) {
super.setConf(conf);
// If running in an Oozie workflow as a Java action, need to add the
// Configuration resource provided by Oozie to this job's config.
String oozieActionConfXml = System.getProperty("oozie.action.conf.xml");
if (oozieActionConfX... |
public InterruptDetectedException() {
super("nospc.U");
}
| public InterruptDetectedException() {
super("intrp.U");
}
|
public int determineBlockFor(ConsistencyLevel consistencyLevel, String table)
{
switch (consistencyLevel)
{
case ONE:
case ANY:
return 1;
case QUORUM:
return (DatabaseDescriptor.getQuorum(table)/ 2) + 1;
case ALL:
... | public int determineBlockFor(ConsistencyLevel consistencyLevel, String table)
{
switch (consistencyLevel)
{
case ONE:
case ANY:
return 1;
case QUORUM:
return (DatabaseDescriptor.getReplicationFactor(table) / 2) + 1;
... |
// - LuceneTestCase.FS_DIRECTORIES is private
// - newFSDirectory returns BaseDirectoryWrapper
// - BaseDirectoryWrapper doesn't expose delegate
Class<? extends FSDirectory> dirImpl = random().nextBoolean() ?
SimpleFSDirectory.class : NIOFSDirectory.class;
args.add(... | // - LuceneTestCase.FS_DIRECTORIES is private
// - newFSDirectory returns BaseDirectoryWrapper
// - BaseDirectoryWrapper doesn't expose delegate
Class<? extends FSDirectory> dirImpl = random().nextBoolean() ?
SimpleFSDirectory.class : NIOFSDirectory.class;
args.add(... |
public static void beforeClass() throws Exception {
initCore("solrconfig-basic.xml", "schema_codec.xml");
}
| public static void beforeClass() throws Exception {
initCore("solrconfig_codec.xml", "schema_codec.xml");
}
|
public SolrConfig(SolrResourceLoader loader, String name, InputSource is)
throws ParserConfigurationException, IOException, SAXException {
super(loader, name, is, "/config/");
initLibs();
luceneMatchVersion = getLuceneVersion("luceneMatchVersion");
String indexConfigPrefix;
// Old indexDefaults... | public SolrConfig(SolrResourceLoader loader, String name, InputSource is)
throws ParserConfigurationException, IOException, SAXException {
super(loader, name, is, "/config/");
initLibs();
luceneMatchVersion = getLuceneVersion("luceneMatchVersion");
String indexConfigPrefix;
// Old indexDefaults... |
private static final String CONNSTRING_FORMAT =
"\\S+@[0-9]+.* \\(XID = .*\\), \\(SESSIONID = [0-9]+\\), " +
"\\(DATABASE = [A-Za-z]+\\), \\(DRDAID = .*\\) ";
| private static final String CONNSTRING_FORMAT =
"\\S+@\\-?[0-9]+.* \\(XID = .*\\), \\(SESSIONID = [0-9]+\\), " +
"\\(DATABASE = [A-Za-z]+\\), \\(DRDAID = .*\\) ";
|
public IndexWriter(Directory d, IndexWriterConfig conf)
throws CorruptIndexException, LockObtainFailedException, IOException {
config = (IndexWriterConfig) conf.clone();
directory = d;
analyzer = conf.getAnalyzer();
setMessageID(defaultInfoStream);
maxFieldLength = conf.getMaxFieldLength();
... | public IndexWriter(Directory d, IndexWriterConfig conf)
throws CorruptIndexException, LockObtainFailedException, IOException {
config = (IndexWriterConfig) conf.clone();
directory = d;
analyzer = conf.getAnalyzer();
setMessageID(defaultInfoStream);
maxFieldLength = conf.getMaxFieldLength();
... |
protected void tearDown() throws Exception {
if (networkServerController != null) {
boolean running = false;
try {
networkServerController.ping();
running = true;
} catch (Exception e) {
}
Throwable failedShu... | protected void tearDown() throws Exception {
if (networkServerController != null) {
boolean running = false;
try {
networkServerController.ping();
running = true;
} catch (Exception e) {
}
Throwable failedShu... |
private long testIndexingWithSuss(long docId) throws Exception {
ConcurrentUpdateSolrServer suss = new ConcurrentUpdateSolrServer(
((HttpSolrServer) clients.get(0)).getBaseURL(), 10, 2);
QueryResponse results = query(cloudClient);
long beforeCount = results.getResults().getNumFound();
int cnt ... | private long testIndexingWithSuss(long docId) throws Exception {
ConcurrentUpdateSolrServer suss = new ConcurrentUpdateSolrServer(
((HttpSolrServer) clients.get(0)).getBaseURL(), 10, 2);
QueryResponse results = query(cloudClient);
long beforeCount = results.getResults().getNumFound();
int cnt ... |
public ShardLeaderElectionContext(LeaderElector leaderElector,
final String shardId, final String collection,
final String coreNodeName, ZkNodeProps props, ZkController zkController, CoreContainer cc) {
super(leaderElector, shardId, collection, coreNodeName, props,
zkController.getZkStateRead... | public ShardLeaderElectionContext(LeaderElector leaderElector,
final String shardId, final String collection,
final String coreNodeName, ZkNodeProps props, ZkController zkController, CoreContainer cc) {
super(leaderElector, shardId, collection, coreNodeName, props,
zkController.getZkStateRead... |
protected void handleRequestSyncAction(SolrQueryRequest req,
SolrQueryResponse rsp) throws IOException {
final SolrParams params = req.getParams();
log.info("I have been requested to sync up my shard");
ZkController zkController = coreContainer.getZkController();
if (zkController == null) {
... | protected void handleRequestSyncAction(SolrQueryRequest req,
SolrQueryResponse rsp) throws IOException {
final SolrParams params = req.getParams();
log.info("I have been requested to sync up my shard");
ZkController zkController = coreContainer.getZkController();
if (zkController == null) {
... |
public void testBadSetup()
{
try {
// setup the server...
String url = "http://127.0.0.1/?core=xxx";
HttpSolrServer s = new HttpSolrServer( url );
Assert.fail( "CommonsHttpSolrServer should not allow a path with a parameter: "+s.getBaseURL() );
}
catch( Exception ex ) {
// ... | public void testBadSetup()
{
try {
// setup the server...
String url = "http" + (isSSLMode() ? "s" : "") + "://127.0.0.1/?core=xxx";
HttpSolrServer s = new HttpSolrServer( url );
Assert.fail( "CommonsHttpSolrServer should not allow a path with a parameter: "+s.getBaseURL() );
}
... |
public void testConnectionRefused() throws MalformedURLException {
int unusedPort = findUnusedPort(); // XXX even if fwe found an unused port
// it might not be unused anymore
HttpSolrServer server = new HttpSolrServer("http://127.0.0.1:" + unusedPort
+ "/solr");... | public void testConnectionRefused() throws MalformedURLException {
int unusedPort = findUnusedPort(); // XXX even if fwe found an unused port
// it might not be unused anymore
HttpSolrServer server = new HttpSolrServer("http" + (isSSLMode() ? "s" : "") + "://127.0.0.1:" ... |
public JettySolrRunner createJetty(File solrHome, String dataDir,
String shardList, String solrConfigOverride, String schemaOverride)
throws Exception {
JettySolrRunner jetty = new JettySolrRunner(solrHome.getAbsolutePath(),
context, 0, solrConfigOverride, schemaOverride);
jetty.setS... | public JettySolrRunner createJetty(File solrHome, String dataDir,
String shardList, String solrConfigOverride, String schemaOverride)
throws Exception {
JettySolrRunner jetty = new JettySolrRunner(solrHome.getAbsolutePath(),
context, 0, solrConfigOverride, schemaOverride, true, null, sslC... |
public String toString()
{
if (SanityManager.DEBUG)
{
return objectName.toString() + super.toString();
}
else
{
return "";
}
}
| public String toString()
{
if (SanityManager.DEBUG)
{
return ((objectName==null)?"":objectName.toString()) + super.toString();
}
else
{
return "";
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.