buggy_function stringlengths 1 391k | fixed_function stringlengths 0 392k |
|---|---|
public void testDeleteFromIndexWriter() throws Exception {
boolean optimize = true;
Directory dir1 = new MockRAMDirectory();
IndexWriter writer = new IndexWriter(dir1, new IndexWriterConfig(TEST_VERSION_CURRENT, new WhitespaceAnalyzer(TEST_VERSION_CURRENT)));
writer.setInfoStream(infoStream);
| public void testDeleteFromIndexWriter() throws Exception {
boolean optimize = true;
Directory dir1 = new MockRAMDirectory();
IndexWriter writer = new IndexWriter(dir1, new IndexWriterConfig(TEST_VERSION_CURRENT, new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).setReaderTermsIndexDivisor(2));
writer.setI... |
public int run(String[] args) throws IOException, ClassNotFoundException, InterruptedException {
addInputOption();
addOutputOption();
addOption("recommenderClassName", "r", "Name of recommender class to instantiate");
addOption("numRecommendations", "n", "Number of recommendations per user", "10");
... | public int run(String[] args) throws IOException, ClassNotFoundException, InterruptedException {
addInputOption();
addOutputOption();
addOption("recommenderClassName", "r", "Name of recommender class to instantiate");
addOption("numRecommendations", "n", "Number of recommendations per user", "10");
... |
private final int format;
TermVectorsReader(Directory d, String segment, FieldInfos fieldInfos)
throws CorruptIndexException, IOException {
this(d, segment, fieldInfos, BufferedIndexInput.BUFFER_SIZE);
}
TermVectorsReader(Directory d, String segment, FieldInfos fieldInfos, int readBufferSize)
thro... | private final int format;
TermVectorsReader(Directory d, String segment, FieldInfos fieldInfos)
throws CorruptIndexException, IOException {
this(d, segment, fieldInfos, BufferedIndexInput.BUFFER_SIZE);
}
TermVectorsReader(Directory d, String segment, FieldInfos fieldInfos, int readBufferSize)
thro... |
public DirectoryReader newReader(Directory indexDir) throws IOException {
TestIndexReaderFactory.newReaderCalled = true;
return DirectoryReader.open(indexDir);
}
}
} | public DirectoryReader newReader(Directory indexDir, SolrCore core) throws IOException {
TestIndexReaderFactory.newReaderCalled = true;
return DirectoryReader.open(indexDir);
}
}
} |
public SolrIndexSearcher(SolrCore core, String path, IndexSchema schema, SolrIndexConfig config, String name, boolean enableCache, DirectoryFactory directoryFactory) throws IOException {
// we don't need to reserve the directory because we get it from the factory
this(core, schema,name, core.getIndexReaderFac... | public SolrIndexSearcher(SolrCore core, String path, IndexSchema schema, SolrIndexConfig config, String name, boolean enableCache, DirectoryFactory directoryFactory) throws IOException {
// we don't need to reserve the directory because we get it from the factory
this(core, schema,name, core.getIndexReaderFac... |
private static void getDetailedFieldInfo(SolrQueryRequest req, String field, SimpleOrderedMap<Object> fieldMap)
throws IOException {
SolrParams params = req.getParams();
int numTerms = params.getInt( NUMTERMS, DEFAULT_COUNT );
TopTermQueue tiq = new TopTermQueue(numTerms + 1); // Something to col... | private static void getDetailedFieldInfo(SolrQueryRequest req, String field, SimpleOrderedMap<Object> fieldMap)
throws IOException {
SolrParams params = req.getParams();
int numTerms = params.getInt( NUMTERMS, DEFAULT_COUNT );
TopTermQueue tiq = new TopTermQueue(numTerms + 1); // Something to col... |
public DirectoryReader newReader(Directory indexDir) throws IOException {
return DirectoryReader.open(indexDir, termInfosIndexDivisor);
}
} | public DirectoryReader newReader(Directory indexDir, SolrCore core) throws IOException {
return DirectoryReader.open(indexDir, termInfosIndexDivisor);
}
} |
public static void verifyEquals(Fields d1, Fields d2) throws IOException {
if (d1 == null) {
assertTrue(d2 == null || d2.getUniqueFieldCount() == 0);
return;
}
assertTrue(d2 != null);
FieldsEnum fieldsEnum1 = d1.iterator();
FieldsEnum fieldsEnum2 = d2.iterator();
String field1;
... | public static void verifyEquals(Fields d1, Fields d2) throws IOException {
if (d1 == null) {
assertTrue(d2 == null || d2.size() == 0);
return;
}
assertTrue(d2 != null);
FieldsEnum fieldsEnum1 = d1.iterator();
FieldsEnum fieldsEnum2 = d2.iterator();
String field1;
while ((field... |
public UpdateRequestProcessor getInstance(SolrQueryRequest req, SolrQueryResponse rsp,
UpdateRequestProcessor next) {
return new UIMAUpdateRequestProcessor(next, req.getCore(),
new SolrUIMAConfigurationReader(args).readSolrUIMAConfiguration());
}
| public UpdateRequestProcessor getInstance(SolrQueryRequest req, SolrQueryResponse rsp,
UpdateRequestProcessor next) {
return new UIMAUpdateRequestProcessor(next, req.getCore().getName(),
new SolrUIMAConfigurationReader(args).readSolrUIMAConfiguration());
}
|
public void transform(Map<String, ?> result, ResponseBuilder rb, SolrDocumentSource solrDocumentSource) {
NamedList<Object> commands = new NamedList<Object>();
for (Map.Entry<String, ?> entry : result.entrySet()) {
Object value = entry.getValue();
if (TopGroups.class.isInstance(value)) {
@... | public void transform(Map<String, ?> result, ResponseBuilder rb, SolrDocumentSource solrDocumentSource) {
NamedList<Object> commands = new NamedList<Object>();
for (Map.Entry<String, ?> entry : result.entrySet()) {
Object value = entry.getValue();
if (TopGroups.class.isInstance(value)) {
@... |
public static void assertTokenStreamContents(TokenStream ts, String[] output, int startOffsets[], int endOffsets[], String types[], int posIncrements[], int posLengths[], Integer finalOffset) throws IOException {
assertNotNull(output);
CheckClearAttributesAttribute checkClearAtt = ts.addAttribute(CheckClearAt... | public static void assertTokenStreamContents(TokenStream ts, String[] output, int startOffsets[], int endOffsets[], String types[], int posIncrements[], int posLengths[], Integer finalOffset) throws IOException {
assertNotNull(output);
CheckClearAttributesAttribute checkClearAtt = ts.addAttribute(CheckClearAt... |
public void readExternal( ObjectInput in ) throws
IOException, ClassNotFoundException {
length = in.readInt();
offset = 0;
if (length > 0) {
bytes = new byte[length];
in.read(bytes, 0, length);
} else {
bytes = null;
}
}
| public void readExternal( ObjectInput in ) throws
IOException, ClassNotFoundException {
length = in.readInt();
offset = 0;
if (length > 0) {
bytes = new byte[length];
in.read(bytes, 0, length);
} else {
bytes = EMPTY_BYTES;
}
}
|
public Explanation explain(final int doc) throws IOException {
Explanation result = new Explanation();
Explanation nonPayloadExpl = super.explain(doc);
result.addDetail(nonPayloadExpl);
//QUESTION: Is there a wau to avoid this skipTo call? We need to know whether to load the paylo... | public Explanation explain(final int doc) throws IOException {
Explanation result = new Explanation();
Explanation nonPayloadExpl = super.explain(doc);
result.addDetail(nonPayloadExpl);
//QUESTION: Is there a wau to avoid this skipTo call? We need to know whether to load the paylo... |
public String toString() {
StringBuilder result = new StringBuilder(200);
result.append("GenericDataModel[users:");
for (int i = 0; i < Math.min(3, userIDs.length); i++) {
| public String toString() {
StringBuilder result = new StringBuilder(200);
result.append("GenericBooleanPrefDataModel[users:");
for (int i = 0; i < Math.min(3, userIDs.length); i++) {
|
public Object run()
{
CodeSource cs = null;
try {
cs = cls.getProtectionDomain().getCodeSource();
}
catch (SecurityException se) {
return se.getMessage();
}
if ( cs == null )
... | public Object run()
{
CodeSource cs = null;
try {
cs = cls.getProtectionDomain().getCodeSource();
}
catch (SecurityException se) {
return se.getMessage();
}
if ( cs == null || c... |
public void testEvaluate() throws Exception {
int nbrules = 100;
Random rng = RandomUtils.getRandom();
int target = 1;
// random rules
List<Rule> rules = Lists.newArrayList();
for (int index = 0; index < nbrules; index++) {
rules.add(new RandomRule(index, target, rng));
}
// da... | public void testEvaluate() throws Exception {
int nbrules = 100;
Random rng = RandomUtils.getRandom();
int target = 1;
// random rules
List<Rule> rules = Lists.newArrayList();
for (int index = 0; index < nbrules; index++) {
rules.add(new RandomRule(index, target, rng));
}
// da... |
public void testSet() throws Exception {
FileSystem fs = FileSystem.get(new Configuration());
Path inpath = fs.makeQualified(new Path(Resources.getResource("wdbc").toString()));
DataSet dataset = FileInfoParser.parseFile(fs, inpath);
DataSet.initialize(dataset);
DataLine dl = new DataLin... | public void testSet() throws Exception {
FileSystem fs = FileSystem.get(new Configuration());
Path inpath = fs.makeQualified(new Path(Resources.getResource("wdbc").toURI()));
DataSet dataset = FileInfoParser.parseFile(fs, inpath);
DataSet.initialize(dataset);
DataLine dl = new DataLine()... |
public FreqProxTermsWriterPerField(TermsHashPerField termsHashPerField, FreqProxTermsWriterPerThread perThread, FieldInfo fieldInfo) {
this.termsHashPerField = termsHashPerField;
this.perThread = perThread;
this.fieldInfo = fieldInfo;
docState = termsHashPerField.docState;
fieldState = termsHashPe... | public FreqProxTermsWriterPerField(TermsHashPerField termsHashPerField, FreqProxTermsWriterPerThread perThread, FieldInfo fieldInfo) {
this.termsHashPerField = termsHashPerField;
this.perThread = perThread;
this.fieldInfo = fieldInfo;
docState = termsHashPerField.docState;
fieldState = termsHashPe... |
protected void setup(Context context) throws IOException, InterruptedException {
super.setup(context);
Parameters params = Parameters.fromString(context.getConfiguration().get(PFPGrowth.PFP_PARAMETERS, ""));
int i = 0;
for (Pair<String,Long> e : PFPGrowth.deserializeList(params, PFPGrowth.F_LIST,... | 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 = Parameters.fromString(context.getConfiguration().get(PFPGrowth.PFP_PARAMETERS, ""));
splitter = Pattern.compile(params.get(PFPGrowth.SPLIT_PATTERN, PFPGrowth.SPLITTER.toString()));
... | protected void setup(Context context) throws IOException, InterruptedException {
super.setup(context);
Parameters params = new Parameters(context.getConfiguration().get(PFPGrowth.PFP_PARAMETERS, ""));
splitter = Pattern.compile(params.get(PFPGrowth.SPLIT_PATTERN, PFPGrowth.SPLITTER.toString()));
}
|
protected void setup(Context context) throws IOException, InterruptedException {
super.setup(context);
Parameters params = Parameters.fromString(context.getConfiguration().get(PFPGrowth.PFP_PARAMETERS, ""));
OpenObjectIntHashMap<String> fMap = new OpenObjectIntHashMap<String>();
int i = 0;
fo... | protected void setup(Context context) throws IOException, InterruptedException {
super.setup(context);
Parameters params = new Parameters(context.getConfiguration().get(PFPGrowth.PFP_PARAMETERS, ""));
OpenObjectIntHashMap<String> fMap = new OpenObjectIntHashMap<String>();
int i = 0;
for (Pair... |
protected void setup(Context context) throws IOException, InterruptedException {
super.setup(context);
Parameters params = Parameters.fromString(context.getConfiguration().get(PFPGrowth.PFP_PARAMETERS, ""));
int i = 0;
for (Pair<String,Long> e : PFPGrowth.deserializeList(params, PFPGrowth.F_... | 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, c... |
protected void setup(Context context) throws IOException, InterruptedException {
super.setup(context);
Parameters params = Parameters.fromString(context.getConfiguration().get("pfp.parameters", ""));
maxHeapSize = Integer.valueOf(params.get("maxHeapSize", "50"));
}
| protected void setup(Context context) throws IOException, InterruptedException {
super.setup(context);
Parameters params = new Parameters(context.getConfiguration().get("pfp.parameters", ""));
maxHeapSize = Integer.valueOf(params.get("maxHeapSize", "50"));
}
|
public void configure(JobConf job) {
try {
Parameters params = Parameters.fromString(job.get("bayes.parameters", ""));
if (params.get("dataSource").equals("hbase")) {
useHbase = true;
} else {
return;
}
hBconf.set(new HBaseConfiguration(job));
table = new... | public void configure(JobConf job) {
try {
Parameters params = new Parameters(job.get("bayes.parameters", ""));
if (params.get("dataSource").equals("hbase")) {
useHbase = true;
} else {
return;
}
hBconf.set(new HBaseConfiguration(job));
table = new HTable... |
public void runJob(Path input, Path output, BayesParameters params) throws IOException {
HadoopUtil.overwriteOutput(output);
log.info("Reading features...");
// Read the features in each document normalized by length of each document
BayesFeatureDriver feature = new BayesFeatureDriver();
feat... | public void runJob(Path input, Path output, BayesParameters params) throws IOException {
HadoopUtil.overwriteOutput(output);
log.info("Reading features...");
// Read the features in each document normalized by length of each document
BayesFeatureDriver feature = new BayesFeatureDriver();
feat... |
public void configure(JobConf job) {
try {
labelWeightSum.clear();
Map<String,Double> labelWeightSumTemp = new HashMap<String,Double>();
DefaultStringifier<Map<String,Double>> mapStringifier = new DefaultStringifier<Map<String,Double>>(job,
GenericsUtil.getClass(labelWeightSumTe... | public void configure(JobConf job) {
try {
labelWeightSum.clear();
Map<String,Double> labelWeightSumTemp = new HashMap<String,Double>();
DefaultStringifier<Map<String,Double>> mapStringifier = new DefaultStringifier<Map<String,Double>>(job,
GenericsUtil.getClass(labelWeightSumTe... |
public void configure(JobConf job) {
try {
Parameters params = Parameters.fromString(job.get("bayes.parameters", ""));
if (params.get("dataSource").equals("hbase")) {
useHbase = true;
} else {
return;
}
HBaseConfiguration hBconf = new HBaseConfiguration(job);
... | public void configure(JobConf job) {
try {
Parameters params = new Parameters(job.get("bayes.parameters", ""));
if (params.get("dataSource").equals("hbase")) {
useHbase = true;
} else {
return;
}
HBaseConfiguration hBconf = new HBaseConfiguration(job);
ta... |
public void configure(JobConf job) {
try {
Parameters params = Parameters.fromString(job.get("bayes.parameters", ""));
if (params.get("dataSource").equals("hbase")) {
useHbase = true;
} else {
return;
}
HBaseConfiguration hBconf = new HBaseConfiguration(job);
... | public void configure(JobConf job) {
try {
Parameters params = new Parameters(job.get("bayes.parameters", ""));
if (params.get("dataSource").equals("hbase")) {
useHbase = true;
} else {
return;
}
HBaseConfiguration hBconf = new HBaseConfiguration(job);
... |
public void runJob(Path input, Path output, BayesParameters params) throws IOException {
HadoopUtil.overwriteOutput(output);
log.info("Reading features...");
// Read the features in each document normalized by length of each document
BayesFeatureDriver feature = new BayesFeatureDriver();
feat... | public void runJob(Path input, Path output, BayesParameters params) throws IOException {
HadoopUtil.overwriteOutput(output);
log.info("Reading features...");
// Read the features in each document normalized by length of each document
BayesFeatureDriver feature = new BayesFeatureDriver();
feat... |
public void configure(JobConf job) {
try {
labelWeightSum.clear();
Map<String,Double> labelWeightSumTemp = new HashMap<String,Double>();
DefaultStringifier<Map<String,Double>> mapStringifier = new DefaultStringifier<Map<String,Double>>(job,
GenericsUtil.getClass(labelWeightSumTe... | public void configure(JobConf job) {
try {
labelWeightSum.clear();
Map<String,Double> labelWeightSumTemp = new HashMap<String,Double>();
DefaultStringifier<Map<String,Double>> mapStringifier = new DefaultStringifier<Map<String,Double>>(job,
GenericsUtil.getClass(labelWeightSumTe... |
public void configure(JobConf job) {
try {
Parameters params = Parameters.fromString(job.get("bayes.parameters", ""));
if (params.get("dataSource").equals("hbase")) {
useHbase = true;
} else {
return;
}
HBaseConfiguration hBconf = new HBaseConfiguration(job);
... | public void configure(JobConf job) {
try {
Parameters params = new Parameters(job.get("bayes.parameters", ""));
if (params.get("dataSource").equals("hbase")) {
useHbase = true;
} else {
return;
}
HBaseConfiguration hBconf = new HBaseConfiguration(job);
ta... |
protected void setup(Context context) throws IOException, InterruptedException {
super.setup(context);
Parameters params = Parameters.fromString(context.getConfiguration().get("job.parameters", ""));
splitter = Pattern.compile(params.get("splitPattern", "[ \t]*\t[ \t]*"));
int selectedFieldCount ... | protected void setup(Context context) throws IOException, InterruptedException {
super.setup(context);
Parameters params = new Parameters(context.getConfiguration().get("job.parameters", ""));
splitter = Pattern.compile(params.get("splitPattern", "[ \t]*\t[ \t]*"));
int selectedFieldCount = Integ... |
public void testMissingEncoder() throws IOException {
try {
new PhoneticFilterFactory(new HashMap<String,String>());
fail();
} catch (IllegalArgumentException expected) {
assertTrue(expected.getMessage().contains("Missing required parameter"));
}
}
| public void testMissingEncoder() throws IOException {
try {
new PhoneticFilterFactory(new HashMap<String,String>());
fail();
} catch (IllegalArgumentException expected) {
assertTrue(expected.getMessage().contains("Configuration Error: missing parameter 'encoder'"));
}
}
|
public ICUTokenizerFactory(Map<String,String> args) {
super(args);
tailored = new HashMap<Integer,String>();
String rulefilesArg = args.remove(RULEFILES);
if (rulefilesArg != null) {
List<String> scriptAndResourcePaths = splitFileNames(rulefilesArg);
for (String scriptAndResourcePath : scr... | public ICUTokenizerFactory(Map<String,String> args) {
super(args);
tailored = new HashMap<Integer,String>();
String rulefilesArg = get(args, RULEFILES);
if (rulefilesArg != null) {
List<String> scriptAndResourcePaths = splitFileNames(rulefilesArg);
for (String scriptAndResourcePath : scrip... |
public ElisionFilterFactory(Map<String,String> args) {
super(args);
articlesFile = args.remove("articles");
ignoreCase = getBoolean(args, "ignoreCase", false);
if (!args.isEmpty()) {
throw new IllegalArgumentException("Unknown parameters: " + args);
}
}
| public ElisionFilterFactory(Map<String,String> args) {
super(args);
articlesFile = get(args, "articles");
ignoreCase = getBoolean(args, "ignoreCase", false);
if (!args.isEmpty()) {
throw new IllegalArgumentException("Unknown parameters: " + args);
}
}
|
public LimitTokenPositionFilterFactory(Map<String,String> args) {
super(args);
maxTokenPosition = getInt(args, MAX_TOKEN_POSITION_KEY);
consumeAllTokens = getBoolean(args, CONSUME_ALL_TOKENS_KEY, false);
if (!args.isEmpty()) {
throw new IllegalArgumentException("Unknown parameters: " + args);
... | public LimitTokenPositionFilterFactory(Map<String,String> args) {
super(args);
maxTokenPosition = requireInt(args, MAX_TOKEN_POSITION_KEY);
consumeAllTokens = getBoolean(args, CONSUME_ALL_TOKENS_KEY, false);
if (!args.isEmpty()) {
throw new IllegalArgumentException("Unknown parameters: " + args)... |
public MockCharFilterFactory(Map<String,String> args) {
super(args);
remainder = getInt(args, "remainder", 0, false);
if (!args.isEmpty()) {
throw new IllegalArgumentException("Unknown parameters: " + args);
}
}
| public MockCharFilterFactory(Map<String,String> args) {
super(args);
remainder = requireInt(args, "remainder");
if (!args.isEmpty()) {
throw new IllegalArgumentException("Unknown parameters: " + args);
}
}
|
public void close() {
if (pending != null) {
pending.cancel(true);
pending = null;
}
scheduler.shutdown();
}
| public void close() {
if (pending != null) {
pending.cancel(true);
pending = null;
}
scheduler.shutdownNow();
}
|
public void run() throws IOException {
Deque<Closeable> closeables = new LinkedList<Closeable>();
try {
Class<? extends Writable> labelType =
sniffInputLabelType(inputPath, conf);
FileSystem fs = FileSystem.get(conf);
Path qPath = new Path(outputPath, "Q-job");
Path btPath = ... | public void run() throws IOException {
Deque<Closeable> closeables = new LinkedList<Closeable>();
try {
Class<? extends Writable> labelType =
sniffInputLabelType(inputPath, conf);
FileSystem fs = FileSystem.get(conf);
Path qPath = new Path(outputPath, "Q-job");
Path btPath = ... |
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... |
public static void assertDrainResults(ResultSet rs,
int expectedRows) throws SQLException
{
ResultSetMetaData rsmd = rs.getMetaData();
int rows = 0;
while (rs.next()) {
for (int col = 1; col <= rsmd.getColumnCount(); col++)
{
String s = rs.getString(col);
Assert.assertEquals(s == null, rs.... | public static void assertDrainResults(ResultSet rs,
int expectedRows) throws SQLException
{
ResultSetMetaData rsmd = rs.getMetaData();
int rows = 0;
while (rs.next()) {
for (int col = 1; col <= rsmd.getColumnCount(); col++)
{
String s = rs.getString(col);
Assert.assertEquals(s == null, rs.... |
public void test() {
HashMap<String,String> args = new HashMap<String,String>();
args.put("hl", "true");
args.put("hl.fl", "tv_text");
args.put("hl.snippets", "2");
args.put("hl.useFastVectorHighlighter", "true");
TestHarness.LocalRequestFactory sumLRF = h.getRequestFactory(
"standard",0... | public void test() {
HashMap<String,String> args = new HashMap<String,String>();
args.put("hl", "true");
args.put("hl.fl", "tv_text");
args.put("hl.snippets", "2");
args.put("hl.useFastVectorHighlighter", "true");
TestHarness.LocalRequestFactory sumLRF = h.getRequestFactory(
"standard",0... |
private void doDelete(DeleteUpdateCommand cmd, List<Node> nodes,
ModifiableSolrParams params) {
flushAdds(1);
DeleteUpdateCommand clonedCmd = clone(cmd);
DeleteRequest deleteRequest = new DeleteRequest();
deleteRequest.cmd = clonedCmd;
deleteRequest.params = params;
for (Node n... | private void doDelete(DeleteUpdateCommand cmd, List<Node> nodes,
ModifiableSolrParams params) {
flushAdds(1);
DeleteUpdateCommand clonedCmd = clone(cmd);
DeleteRequest deleteRequest = new DeleteRequest();
deleteRequest.cmd = clonedCmd;
deleteRequest.params = params;
for (Node n... |
public void testAltReaderUsed() throws Exception {
IndexReaderFactory readerFactory = h.getCore().getIndexReaderFactory();
assertNotNull("Factory is null", readerFactory);
assertTrue("readerFactory is not an instanceof " + AlternateIndexReaderTest.TestIndexReaderFactory.class, readerFactory instanceof Sta... | public void testAltReaderUsed() throws Exception {
IndexReaderFactory readerFactory = h.getCore().getIndexReaderFactory();
assertNotNull("Factory is null", readerFactory);
assertTrue("readerFactory is not an instanceof " + AlternateDirectoryTest.TestIndexReaderFactory.class, readerFactory instanceof Stand... |
public FileImpl(File f, File rootFile)
{
file = f;
this.rootDirFile = rootFile;
rootDir = rootFile.getAbsolutePath();
if (f.equals(rootFile)) name = "";
else name = file.getAbsolutePath().substring(rootDir.length() + 1);
}
| public FileImpl(File f, File rootFile)
{
file = f;
this.rootDirFile = rootFile;
rootDir = rootFile.getAbsolutePath();
if (f.equals(rootFile)) name = "";
else name = file.getAbsolutePath().substring(rootDir.length() + 1).replace('\\', '/');
}
|
public void setup() throws IOException, ConfigurationException
{
tmd.clearUnsafe();
IPartitioner partitioner = new RandomPartitioner();
oldPartitioner = ss.setPartitionerUnsafe(partitioner);
// create a ring of 5 nodes
Util.createInitialRing(ss, partitioner, endpointTok... | public void setup() throws IOException, ConfigurationException
{
tmd.clearUnsafe();
IPartitioner partitioner = new RandomPartitioner();
oldPartitioner = ss.setPartitionerUnsafe(partitioner);
// create a ring of 5 nodes
Util.createInitialRing(ss, partitioner, endpointTok... |
public List<String> get_key_range(String tablename, String columnFamily, String startWith, String stopAt, int maxResults) throws InvalidRequestException, TException
{
if (logger.isDebugEnabled())
logger.debug("get_key_range");
ThriftValidation.validateCommand(tablename, columnFamily)... | public List<String> get_key_range(String tablename, String columnFamily, String startWith, String stopAt, int maxResults, int consistency_level) throws InvalidRequestException, TException
{
if (logger.isDebugEnabled())
logger.debug("get_key_range");
ThriftValidation.validateCommand(t... |
private void executeGet(Tree statement)
throws TException, NotFoundException, InvalidRequestException, UnavailableException, TimedOutException, IllegalAccessException, InstantiationException, ClassNotFoundException, NoSuchFieldException
{
if (!CliMain.isConnected() || !hasKeySpace())
... | private void executeGet(Tree statement)
throws TException, NotFoundException, InvalidRequestException, UnavailableException, TimedOutException, IllegalAccessException, InstantiationException, ClassNotFoundException, NoSuchFieldException
{
if (!CliMain.isConnected() || !hasKeySpace())
... |
public void doVerb(Message message)
{
byte[] body = message.getMessageBody();
DataInputBuffer bufIn = new DataInputBuffer();
bufIn.reset(body, body.length);
try
{
BootstrapInitiateMessage biMsg = BootstrapInitiateM... | public void doVerb(Message message)
{
byte[] body = message.getMessageBody();
DataInputBuffer bufIn = new DataInputBuffer();
bufIn.reset(body, body.length);
try
{
BootstrapInitiateMessage biMsg = BootstrapInitiateM... |
private void preParse(File rootDirectory, String table, String cfName) throws Throwable
{
File[] files = rootDirectory.listFiles();
for ( File file : files )
{
if ( file.isDirectory() )
preParse(file, table, cfName);
else
... | private void preParse(File rootDirectory, String table, String cfName) throws Throwable
{
File[] files = rootDirectory.listFiles();
for ( File file : files )
{
if ( file.isDirectory() )
preParse(file, table, cfName);
else
... |
public synchronized void execute() throws Exception {
if (executed) {
throw new Exception("Benchmark was already executed");
}
executed = true;
algorithm.execute();
}
| public synchronized void execute() throws Exception {
if (executed) {
throw new IllegalStateException("Benchmark was already executed");
}
executed = true;
algorithm.execute();
}
|
public void init(Context context) {
super.init(context);
// set attributes using XXX getXXXFromContext(attribute, defualtValue);
// applies variable resolver and return default if value is not found or null
// REQUIRED : connection and folder info
user = getStringFromContext("user", null);
pa... | public void init(Context context) {
super.init(context);
// set attributes using XXX getXXXFromContext(attribute, defualtValue);
// applies variable resolver and return default if value is not found or null
// REQUIRED : connection and folder info
user = getStringFromContext("user", null);
pa... |
public void testMBeanInterface() throws Exception {
ProvisioningServiceMBean mbean = getMBean(ProvisioningServiceMBean.OBJECTNAME, ProvisioningServiceMBean.class);
assertNotNull(mbean);
ServiceTracker tracker = new ServiceTracker(bundleContext, ProvisioningService.class.getName(), ... | public void testMBeanInterface() throws Exception {
ProvisioningServiceMBean mbean = getMBean(ProvisioningServiceMBean.OBJECTNAME, ProvisioningServiceMBean.class);
assertNotNull(mbean);
ServiceTracker tracker = new ServiceTracker(bundleContext, ProvisioningService.class.getName(), ... |
public void testMBeanInterface() throws Exception {
ConfigurationAdminMBean mbean = getMBean(ConfigurationAdminMBean.OBJECTNAME, ConfigurationAdminMBean.class);
assertNotNull(mbean);
// get bundles
Bundle a = getBundle("org.apache.aries.jmx.test.bundlea");
... | public void testMBeanInterface() throws Exception {
ConfigurationAdminMBean mbean = getMBean(ConfigurationAdminMBean.OBJECTNAME, ConfigurationAdminMBean.class);
assertNotNull(mbean);
// get bundles
Bundle a = getBundle("org.apache.aries.jmx.test.bundlea");
... |
public String getString() throws StandardException
{
if (value == null) {
int len = rawLength;
if (len != -1) {
// data is stored in the char[] array
value = new String(rawData, 0, len);
if (len > RETURN_SPACE_THRESHOLD) {
... | public String getString() throws StandardException
{
if (value == null) {
int len = rawLength;
if (len != -1) {
// data is stored in the char[] array
value = new String(rawData, 0, len);
if (len > RETURN_SPACE_THRESHOLD) {
... |
public utilMain(int numConnections, LocalizedOutput out, Hashtable ignoreErrors)
throws ijFatalException
{
/* init the parser; give it no input to start with.
* (1 parser for entire test.)
*/
charStream = new UCode_CharStream(
new StringReader(" "), 1, 1);
ijTokMgr = new ijTokenManager(charStream)... | public utilMain(int numConnections, LocalizedOutput out, Hashtable ignoreErrors)
throws ijFatalException
{
/* init the parser; give it no input to start with.
* (1 parser for entire test.)
*/
charStream = new UCode_CharStream(
new StringReader(" "), 1, 1);
ijTokMgr = new ijTokenManager(charStream)... |
public T get() throws TimeoutException, DigestMismatchException, IOException
{
long timeout = DatabaseDescriptor.getRpcTimeout() - (System.currentTimeMillis() - startTime);
try
{
condition.await(timeout, TimeUnit.MILLISECONDS);
}
catch (InterruptedException ex... | public T get() throws TimeoutException, DigestMismatchException, IOException
{
long timeout = DatabaseDescriptor.getRpcTimeout() - (System.currentTimeMillis() - startTime);
try
{
condition.await(timeout, TimeUnit.MILLISECONDS);
}
catch (InterruptedException ex... |
public void readTermsBlock(IndexInput termsIn, FieldInfo fieldInfo, BlockTermState _termState) throws IOException {
final StandardTermState termState = (StandardTermState) _termState;
final int len = termsIn.readVInt();
//System.out.println("SPR.readTermsBlock termsIn.fp=" + termsIn.getFilePointer());
... | public void readTermsBlock(IndexInput termsIn, FieldInfo fieldInfo, BlockTermState _termState) throws IOException {
final StandardTermState termState = (StandardTermState) _termState;
final int len = termsIn.readVInt();
//System.out.println("SPR.readTermsBlock termsIn.fp=" + termsIn.getFilePointer());
... |
public void shutdown() {
// allow only one caller to shut the monitor down
synchronized (this) {
if (inShutdown)
return;
inShutdown = true;
}
long shutdownTime = System.currentTimeMillis();
//Make a note of Engine shutdown in the log file
Monitor.getStream().printlnWithHeader("\n" + CheapDateFor... | public void shutdown() {
// allow only one caller to shut the monitor down
synchronized (this) {
if (inShutdown)
return;
inShutdown = true;
}
long shutdownTime = System.currentTimeMillis();
//Make a note of Engine shutdown in the log file
Monitor.getStream().printlnWithHeader("\n" +
COLON +
... |
public static void main(String[] args) throws IOException {
DefaultOptionBuilder obuilder = new DefaultOptionBuilder();
ArgumentBuilder abuilder = new ArgumentBuilder();
GroupBuilder gbuilder = new GroupBuilder();
Option seqOpt = obuilder.withLongName("seqFile").withRequired(false).withArgument(
... | public static void main(String[] args) throws IOException {
DefaultOptionBuilder obuilder = new DefaultOptionBuilder();
ArgumentBuilder abuilder = new ArgumentBuilder();
GroupBuilder gbuilder = new GroupBuilder();
Option seqOpt = obuilder.withLongName("seqFile").withRequired(false).withArgument(
... |
public void testCollate() throws Exception {
assertJQ(req("json.nl","map", "qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", SpellCheckComponent.SPELLCHECK_BUILD, "true", "q","documemt", SpellCheckComponent.SPELLCHECK_COLLATE, "true")
,"/spellcheck/suggestions/collation=='document'"
);
assertJQ(... | public void testCollate() throws Exception {
assertJQ(req("json.nl","map", "qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", SpellCheckComponent.SPELLCHECK_BUILD, "true", "q","documemt", SpellCheckComponent.SPELLCHECK_COLLATE, "true")
,"/spellcheck/suggestions/collation=='document'"
);
assertJQ(... |
private static void createCanopyFromVectorsSeq(Path input, Path output, DistanceMeasure measure) throws IOException {
Configuration conf = new Configuration();
FileSystem fs = FileSystem.get(input.toUri(), conf);
FileStatus[] status = fs.listStatus(input, PathFilters.logsCRCFilter());
int part = 0;
... | private static void createCanopyFromVectorsSeq(Path input, Path output, DistanceMeasure measure) throws IOException {
Configuration conf = new Configuration();
FileSystem fs = FileSystem.get(input.toUri(), conf);
FileStatus[] status = fs.listStatus(input, PathFilters.logsCRCFilter());
int part = 0;
... |
protected void map(WritableComparable<?> key, VectorWritable point, Context context) throws IOException, InterruptedException {
MeanShiftCanopy canopy = new MeanShiftCanopy(point.get(), nextCanopyId++, measure);
context.write(new Text(key.toString()), canopy);
}
| protected void map(WritableComparable<?> key, VectorWritable point, Context context) throws IOException, InterruptedException {
MeanShiftCanopy canopy = MeanShiftCanopy.initialCanopy(point.get(), nextCanopyId++, measure);
context.write(new Text(key.toString()), canopy);
}
|
public void checkpoint(SegmentInfos segmentInfos, boolean isCommit) throws IOException {
assert locked();
assert Thread.holdsLock(writer);
if (infoStream.isEnabled("IFD")) {
infoStream.message("IFD", "now checkpoint \"" + writer.segString(segmentInfos) + "\" [" + segmentInfos.size() + " segments "... | public void checkpoint(SegmentInfos segmentInfos, boolean isCommit) throws IOException {
assert locked();
assert Thread.holdsLock(writer);
if (infoStream.isEnabled("IFD")) {
infoStream.message("IFD", "now checkpoint \"" + writer.segString(writer.toLiveInfos(segmentInfos)) + "\" [" + segmentInfos.s... |
public void setNextReader(AtomicReaderContext context) {
this.docBase = docBase;
}
| public void setNextReader(AtomicReaderContext context) {
docBase = context.docBase;
}
|
public void setNextReader(AtomicReaderContext context) throws IOException {
this.docBase = context.docBase;
for (int i = 0; i < comparators.length; i++) {
queue.setComparator(i, comparators[i].setNextReader(context));
}
}
| public void setNextReader(AtomicReaderContext context) throws IOException {
docBase = context.docBase;
for (int i = 0; i < comparators.length; i++) {
queue.setComparator(i, comparators[i].setNextReader(context));
}
}
|
private List<Object> getAllDecendentReaderKeys(Object seed) {
List<Object> all = new ArrayList<Object>(17); // will grow as we iter
all.add(seed);
for (int i = 0; i < all.size(); i++) {
Object obj = all.get(i);
if (obj instanceof IndexReader) {
IndexReader[] subs = ((IndexReader)obj).g... | private List<Object> getAllDecendentReaderKeys(Object seed) {
List<Object> all = new ArrayList<Object>(17); // will grow as we iter
all.add(seed);
for (int i = 0; i < all.size(); i++) {
Object obj = all.get(i);
if (obj instanceof IndexReader) {
IndexReader[] subs = ((IndexReader)obj).g... |
private QueryBuilder getBuilder(QueryNode node) {
QueryBuilder builder = null;
if (this.fieldNameBuilders != null && node instanceof FieldableNode) {
builder = this.fieldNameBuilders.get(StringUtils
.toString(((FieldableNode) node).getField()));
}
if (builder == null && this.queryNod... | private QueryBuilder getBuilder(QueryNode node) {
QueryBuilder builder = null;
if (this.fieldNameBuilders != null && node instanceof FieldableNode) {
builder = this.fieldNameBuilders.get(StringUtils
.toString(((FieldableNode) node).getField()));
}
if (builder == null && this.queryNod... |
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 void testDirectSource() throws Exception {
DirectoryReader indexReader = DirectoryReader.open(indexDir);
TaxonomyReader taxoReader = new DirectoryTaxonomyReader(taxoDir);
IndexSearcher searcher = new IndexSearcher(indexReader);
FacetSearchParams fsp = new FacetSearchParams(new CountFacetRe... | public void testDirectSource() throws Exception {
DirectoryReader indexReader = DirectoryReader.open(indexDir);
TaxonomyReader taxoReader = new DirectoryTaxonomyReader(taxoDir);
IndexSearcher searcher = new IndexSearcher(indexReader);
FacetSearchParams fsp = new FacetSearchParams(new CountFacetRe... |
public ExecRow getPreviousRow()
throws StandardException
{
if ( ! isOpen )
{
throw StandardException.newException(SQLState.LANG_RESULT_SET_NOT_OPEN, "next");
}
if (SanityManager.DEBUG)
{
if (!isTopResultSet)
{
SanityManager.THROWASSERT(
this + "expected to be the top ResultSet");
... | public ExecRow getPreviousRow()
throws StandardException
{
if ( ! isOpen )
{
throw StandardException.newException(SQLState.LANG_RESULT_SET_NOT_OPEN, "previous");
}
if (SanityManager.DEBUG)
{
if (!isTopResultSet)
{
SanityManager.THROWASSERT(
this + "expected to be the top ResultSet"... |
public void runMayThrow() throws InterruptedException, IOException
{
condition.await();
if (writeCommitLog)
{
// if we're not writing to the commit log, we are replaying the log, so marking
... | public void runMayThrow() throws InterruptedException, IOException
{
condition.await();
if (writeCommitLog)
{
// if we're not writing to the commit log, we are replaying the log, so marking
... |
public Object clone() {
try {
return (Query)super.clone();
} catch (CloneNotSupportedException e) {
throw new RuntimeException(e);
}
}
| public Object clone() {
try {
return (Query)super.clone();
} catch (CloneNotSupportedException e) {
throw new RuntimeException("Clone not supported: " + e.getMessage());
}
}
|
public static void shutdownAndAwaitTermination(ExecutorService pool) {
pool.shutdown(); // Disable new tasks from being submitted
boolean shutdown = false;
while (!shutdown) {
try {
// Wait a while for existing tasks to terminate
shutdown = pool.awaitTermination(30, TimeUnit.SECONDS)... | public static void shutdownAndAwaitTermination(ExecutorService pool) {
pool.shutdown(); // Disable new tasks from being submitted
boolean shutdown = false;
while (!shutdown) {
try {
// Wait a while for existing tasks to terminate
shutdown = pool.awaitTermination(60, TimeUnit.SECONDS)... |
public boolean anyDocValuesFields() {
for (FieldInfo fi : fieldInfos) {
if (fi.hasDocValues()) {
return true;
}
}
| public boolean anyDocValuesFields() {
for (FieldInfo fi : this) {
if (fi.hasDocValues()) {
return true;
}
}
|
private void loadExternalFileDictionary(IndexSchema schema, SolrResourceLoader loader) {
IndexSearcher searcher = null;
try {
// Get the field's analyzer
if (fieldTypeName != null
&& schema.getFieldTypeNoEx(fieldTypeName) != null) {
FieldType fieldType = schema.getFieldTypes... | private void loadExternalFileDictionary(IndexSchema schema, SolrResourceLoader loader) {
IndexSearcher searcher = null;
try {
// Get the field's analyzer
if (fieldTypeName != null
&& schema.getFieldTypeNoEx(fieldTypeName) != null) {
FieldType fieldType = schema.getFieldTypes... |
public void testGuessToken() throws IOException
{
StorageService ss = StorageService.instance();
generateFakeEndpoints(3);
InetAddress one = InetAddress.getByName("127.0.0.2");
InetAddress two = InetAddress.getByName("127.0.0.3");
InetAddress three = InetAddress.getByNa... | public void testGuessToken() throws IOException
{
StorageService ss = StorageService.instance();
generateFakeEndpoints(3);
InetAddress one = InetAddress.getByName("127.0.0.2");
InetAddress two = InetAddress.getByName("127.0.0.3");
InetAddress three = InetAddress.getByNa... |
public final void checkHostVariable(int declaredLength) throws StandardException
{
// stream length checking occurs at the JDBC layer
int variableLength = -1;
if (stream == null)
{
if (dataValue != null)
variableLength = dataValue.length;
}
else
{
variableLength = streamValueLength;
}
if ... | public final void checkHostVariable(int declaredLength) throws StandardException
{
// stream length checking occurs at the JDBC layer
int variableLength = -1;
if (stream == null)
{
if (dataValue != null)
variableLength = dataValue.length;
}
else
{
variableLength = streamValueLength;
}
if ... |
region specified by the existing Derby attribute called territory.
/*
Derby - Class org.apache.derby.iapi.reference.Attribute
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 regar... | region specified by the existing Derby attribute called territory.
/*
Derby - Class org.apache.derby.iapi.reference.Attribute
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 regar... |
public void flush(Map<InvertedDocEndConsumerPerThread,Collection<InvertedDocEndConsumerPerField>> threadsAndFields, SegmentWriteState state) throws IOException {
final Map<FieldInfo,List<NormsWriterPerField>> byField = new HashMap<FieldInfo,List<NormsWriterPerField>>();
// Typically, each thread will have e... | public void flush(Map<InvertedDocEndConsumerPerThread,Collection<InvertedDocEndConsumerPerField>> threadsAndFields, SegmentWriteState state) throws IOException {
final Map<FieldInfo,List<NormsWriterPerField>> byField = new HashMap<FieldInfo,List<NormsWriterPerField>>();
// Typically, each thread will have e... |
private static void deleteColumnOrSuperColumnToRowMutation(RowMutation rm, String cfName, Deletion del)
{
if (del.predicate != null && del.predicate.column_names != null)
{
for(byte[] c : del.predicate.column_names)
{
if (del.super_column == null && Databa... | private static void deleteColumnOrSuperColumnToRowMutation(RowMutation rm, String cfName, Deletion del)
{
if (del.predicate != null && del.predicate.column_names != null)
{
for(byte[] c : del.predicate.column_names)
{
if (del.super_column == null && Databa... |
private static void deleteColumnOrSuperColumnToRowMutation(RowMutation rm, String cfName, Deletion del)
{
if (del.predicate != null && del.predicate.column_names != null)
{
for (ByteBuffer col : del.predicate.column_names)
{
if (del.super_column == null &&... | private static void deleteColumnOrSuperColumnToRowMutation(RowMutation rm, String cfName, Deletion del)
{
if (del.predicate != null && del.predicate.column_names != null)
{
for (ByteBuffer col : del.predicate.column_names)
{
if (del.super_column == null &&... |
public boolean isRPCServerRunning()
{
if (daemon == null)
{
throw new IllegalStateException("No configured RPC daemon");
}
return daemon.isRPCServerRunning();
}
| public boolean isRPCServerRunning()
{
if (daemon == null)
{
return false;
}
return daemon.isRPCServerRunning();
}
|
public static void doTriggers (Connection conn)
throws SQLException
{
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT TRIGGERNAME, SCHEMAID, " +
"EVENT, FIRINGTIME, TYPE, TABLEID, REFERENCEDCOLUMNS, " +
"TRIGGERDEFINITION, REFERENCINGOLD, REFERENCINGNEW, OLDREFERENCINGN... | public static void doTriggers (Connection conn)
throws SQLException
{
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT TRIGGERNAME, SCHEMAID, " +
"EVENT, FIRINGTIME, TYPE, TABLEID, REFERENCEDCOLUMNS, " +
"TRIGGERDEFINITION, REFERENCINGOLD, REFERENCINGNEW, OLDREFERENCINGN... |
public static void doIndexes(Connection conn)
throws SQLException
{
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT TABLEID, CONGLOMERATENAME, " +
"DESCRIPTOR, SCHEMAID, ISINDEX, ISCONSTRAINT FROM SYS.SYSCONGLOMERATES " +
"ORDER BY TABLEID");
boolean firstTime = true;... | public static void doIndexes(Connection conn)
throws SQLException
{
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT TABLEID, CONGLOMERATENAME, " +
"DESCRIPTOR, SCHEMAID, ISINDEX, ISCONSTRAINT FROM SYS.SYSCONGLOMERATES " +
"ORDER BY TABLEID");
boolean firstTime = true;... |
public static void doTables(Connection conn, HashMap tableIdToNameMap)
throws SQLException
{
// Prepare some statements for general use by this class.
getColumnInfoStmt =
conn.prepareStatement("SELECT C.COLUMNNAME, C.REFERENCEID, " +
"C.COLUMNNUMBER FROM SYS.SYSCOLUMNS C, SYS.SYSTABLES T WHERE T.TABLEID... | public static void doTables(Connection conn, HashMap tableIdToNameMap)
throws SQLException
{
// Prepare some statements for general use by this class.
getColumnInfoStmt =
conn.prepareStatement("SELECT C.COLUMNNAME, C.REFERENCEID, " +
"C.COLUMNNUMBER FROM SYS.SYSCOLUMNS C, SYS.SYSTABLES T WHERE T.TABLEID... |
public static void doStoredProcedures(Connection conn)
throws SQLException {
// Note: it is safe to cast the long varchar column "javaclassname"
// to varchar(128) because it is defined to correspond to the
// 'aliasid' column for a given stored procedure; since the aliasid
// column is varchar(128), javacl... | public static void doStoredProcedures(Connection conn)
throws SQLException {
// Note: it is safe to cast the long varchar column "javaclassname"
// to varchar(128) because it is defined to correspond to the
// 'aliasid' column for a given stored procedure; since the aliasid
// column is varchar(128), javacl... |
public static void doViews(Connection conn)
throws SQLException {
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT V.VIEWDEFINITION, " +
"T.TABLENAME, T.SCHEMAID, V.COMPILATIONSCHEMAID FROM SYS.SYSVIEWS V, " +
"SYS.SYSTABLES T WHERE T.TABLEID = V.TABLEID");
boolean firs... | public static void doViews(Connection conn)
throws SQLException {
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT V.VIEWDEFINITION, " +
"T.TABLENAME, T.SCHEMAID, V.COMPILATIONSCHEMAID FROM SYS.SYSVIEWS V, " +
"SYS.SYSTABLES T WHERE T.TABLEID = V.TABLEID");
boolean firs... |
public static void doJars(String dbName, Connection conn)
throws SQLException
{
String separator = System.getProperty("file.separator");
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT FILENAME, SCHEMAID, " +
"GENERATIONID FROM SYS.SYSFILES");
boolean firstTime = true;... | public static void doJars(String dbName, Connection conn)
throws SQLException
{
String separator = System.getProperty("file.separator");
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT FILENAME, SCHEMAID, " +
"GENERATIONID FROM SYS.SYSFILES");
boolean firstTime = true;... |
public static void doChecks(Connection conn)
throws SQLException
{
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT CS.CONSTRAINTNAME, " +
"CS.TABLEID, CS.SCHEMAID, CK.CHECKDEFINITION FROM SYS.SYSCONSTRAINTS CS, " +
"SYS.SYSCHECKS CK WHERE CS.CONSTRAINTID = " +
"CK.CON... | public static void doChecks(Connection conn)
throws SQLException
{
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT CS.CONSTRAINTNAME, " +
"CS.TABLEID, CS.SCHEMAID, CK.CHECKDEFINITION FROM SYS.SYSCONSTRAINTS CS, " +
"SYS.SYSCHECKS CK WHERE CS.CONSTRAINTID = " +
"CK.CON... |
public static void doSchemas(Connection conn,
boolean tablesOnly) throws SQLException
{
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT SCHEMANAME, SCHEMAID " +
"FROM SYS.SYSSCHEMAS");
boolean firstTime = true;
while (rs.next()) {
String sName = dblook.addQuotes(
... | public static void doSchemas(Connection conn,
boolean tablesOnly) throws SQLException
{
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT SCHEMANAME, SCHEMAID " +
"FROM SYS.SYSSCHEMAS");
boolean firstTime = true;
while (rs.next()) {
String sName = dblook.addQuotes(
... |
public void run() {
try {
cc.createStatement().execute(sql);
result = "Sleep thread completed " + sql;
} catch (SQLException sqle) {
// this is to avoid different cannons for different JVMs since
// an java.lang.InterruptedException is thrown.
StringBuffer sb = new StringBuffer();
sb.append(sql... | public void run() {
try {
cc.createStatement().execute(sql);
result = "Sleep thread completed " + sql;
} catch (SQLException sqle) {
// this is to avoid different cannons for different JVMs since
// an java.lang.InterruptedException is thrown.
StringBuffer sb = new StringBuffer();
sb.append(sql... |
public void finishStage(ResponseBuilder rb) {
SolrParams params = rb.req.getParams();
if (!params.getBool(COMPONENT_NAME, false) || rb.stage != ResponseBuilder.STAGE_GET_FIELDS)
return;
boolean extendedResults = params.getBool(SPELLCHECK_EXTENDED_RESULTS, false);
boolean collate = params.getBoo... | public void finishStage(ResponseBuilder rb) {
SolrParams params = rb.req.getParams();
if (!params.getBool(COMPONENT_NAME, false) || rb.stage != ResponseBuilder.STAGE_GET_FIELDS)
return;
boolean extendedResults = params.getBool(SPELLCHECK_EXTENDED_RESULTS, false);
boolean collate = params.getBoo... |
public SpellingResult getSuggestions(SpellingOptions options) throws IOException {
boolean shardRequest = false;
SolrParams params = options.customParams;
if(params!=null)
{
shardRequest = "true".equals(params.get(ShardParams.IS_SHARD));
}
SpellingResult result = new SpellingResult(options.toke... | public SpellingResult getSuggestions(SpellingOptions options) throws IOException {
boolean shardRequest = false;
SolrParams params = options.customParams;
if(params!=null)
{
shardRequest = "true".equals(params.get(ShardParams.IS_SHARD));
}
SpellingResult result = new SpellingResult(options.toke... |
private void processMessages( File input, PrintWriter propertiesPW, XMLWriter ditaWriter )
throws Exception
{
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document ... | private void processMessages( File input, PrintWriter propertiesPW, XMLWriter ditaWriter )
throws Exception
{
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document ... |
private void startBootstrap(Token token) throws IOException
{
isBootstrapMode = true;
SystemTable.updateToken(token); // DON'T use setToken, that makes us part of the ring locally which is incorrect until we are done bootstrapping
Gossiper.instance.addLocalApplicationState(ApplicationSta... | private void startBootstrap(Token token) throws IOException
{
isBootstrapMode = true;
SystemTable.updateToken(token); // DON'T use setToken, that makes us part of the ring locally which is incorrect until we are done bootstrapping
Gossiper.instance.addLocalApplicationState(ApplicationSta... |
private void readFromStream(InputStream in) throws IOException {
dataValue = null; // allow gc of the old value before the new.
byte[] tmpData = new byte[32 * 1024];
int off = 0;
for (;;) {
int len = in.read(tmpData, off, tmpData.length - off);
if (len == -1)
break;
off += len;
int avail... | private void readFromStream(InputStream in) throws IOException {
dataValue = null; // allow gc of the old value before the new.
byte[] tmpData = new byte[32 * 1024];
int off = 0;
for (;;) {
int len = in.read(tmpData, off, tmpData.length - off);
if (len == -1)
break;
off += len;
int avail... |
public Explanation explain(final int doc) throws IOException {
Explanation result = new Explanation();
Explanation nonPayloadExpl = super.explain(doc);
result.addDetail(nonPayloadExpl);
//QUESTION: Is there a wau to avoid this skipTo call? We need to know whether to load the paylo... | public Explanation explain(final int doc) throws IOException {
Explanation result = new Explanation();
Explanation nonPayloadExpl = super.explain(doc);
result.addDetail(nonPayloadExpl);
//QUESTION: Is there a wau to avoid this skipTo call? We need to know whether to load the paylo... |
public void testIndexingThenDeleting() throws Exception {
final Random r = random;
Directory dir = newDirectory();
// note this test explicitly disables payloads
final Analyzer analyzer = new WhitespaceAnalyzer(TEST_VERSION_CURRENT);
FlushCountingIndexWriter w = new FlushCountingIndexWriter(dir, ... | public void testIndexingThenDeleting() throws Exception {
final Random r = random;
Directory dir = newDirectory();
// note this test explicitly disables payloads
final Analyzer analyzer = new WhitespaceAnalyzer(TEST_VERSION_CURRENT);
FlushCountingIndexWriter w = new FlushCountingIndexWriter(dir, ... |
private void resolve(String key, byte[] buffer)
{
columnFamilies_.put(key, buffer);
currentSize_.addAndGet(buffer.length + key.length());
}
/*
*
*/
void flush() throws IOException
{
if ( columnFamilies_.size() == 0 )
return;
/*
... | private void resolve(String key, byte[] buffer)
{
columnFamilies_.put(key, buffer);
currentSize_.addAndGet(buffer.length + key.length());
}
/*
*
*/
void flush() throws IOException
{
if ( columnFamilies_.size() == 0 )
return;
/*
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.