buggy_function stringlengths 1 391k | fixed_function stringlengths 0 392k |
|---|---|
private void mergeSimpleNorms(SegmentWriteState segmentWriteState) throws IOException {
if (codec.simpleNormsFormat() != null) {
SimpleDVConsumer consumer = codec.simpleNormsFormat().normsConsumer(segmentWriteState);
boolean success = false;
try {
for (FieldInfo field : mergeState.fieldI... | private void mergeSimpleNorms(SegmentWriteState segmentWriteState) throws IOException {
if (codec.simpleNormsFormat() != null) {
SimpleDVConsumer consumer = codec.simpleNormsFormat().normsConsumer(segmentWriteState);
boolean success = false;
try {
for (FieldInfo field : mergeState.fieldI... |
private File getRelativeSolrHomePath(File solrHome) {
String path = SolrResourceLoader.normalizeDir(new File(".").getAbsolutePath());
String base = new File(solrHome.getPath()).getAbsolutePath();
if (base.startsWith("."));
base.replaceFirst("\\.", new File(".").getName());
if (path.endsW... | private File getRelativeSolrHomePath(File solrHome) {
String path = SolrResourceLoader.normalizeDir(new File(".").getAbsolutePath());
String base = new File(solrHome.getPath()).getAbsolutePath();
if (base.startsWith("."));
base.replaceFirst("\\.", new File(".").getName());
if (path.endsW... |
public void abort() {}
BytesRef payload;
/* Walk through all unique text tokens (Posting
* instances) found in this field and serialize them
* into a single RAM segment. */
void flush(String fieldName, FieldsConsumer consumer, final SegmentWriteState state)
throws CorruptIndexException, IOException... | public void abort() {}
BytesRef payload;
/* Walk through all unique text tokens (Posting
* instances) found in this field and serialize them
* into a single RAM segment. */
void flush(String fieldName, FieldsConsumer consumer, final SegmentWriteState state)
throws CorruptIndexException, IOException... |
public CostEstimate optimizeIt(Optimizer optimizer,
OptimizablePredicateList predList,
CostEstimate outerCost,
RowOrdering rowOrdering)
throws StandardException
{
/*
** RESOLVE: Most types of Optimizables only implement estimateCost(),
** and leave it up to optimizeIt() in FromTable to f... | public CostEstimate optimizeIt(Optimizer optimizer,
OptimizablePredicateList predList,
CostEstimate outerCost,
RowOrdering rowOrdering)
throws StandardException
{
/*
** RESOLVE: Most types of Optimizables only implement estimateCost(),
** and leave it up to optimizeIt() in FromTable to f... |
public CostEstimate optimizeIt(
Optimizer optimizer,
OptimizablePredicateList predList,
CostEstimate outerCost,
RowOrdering rowOrdering)
throws StandardException
{
/*
** RESOLVE: Most types of Optimizables only implement estimateCost(),
** and leave it up to optimizeIt() in FromTa... | public CostEstimate optimizeIt(
Optimizer optimizer,
OptimizablePredicateList predList,
CostEstimate outerCost,
RowOrdering rowOrdering)
throws StandardException
{
/*
** RESOLVE: Most types of Optimizables only implement estimateCost(),
** and leave it up to optimizeIt() in FromTa... |
public CostEstimate optimizeIt(
Optimizer optimizer,
OptimizablePredicateList predList,
CostEstimate outerCost,
RowOrdering rowOrdering)
throws StandardException
{
optimizer.trace(Optimizer.CALLING_ON_JOIN_NODE, 0, 0, 0.0, null);
// It's possible that a call to optimize the left/ri... | public CostEstimate optimizeIt(
Optimizer optimizer,
OptimizablePredicateList predList,
CostEstimate outerCost,
RowOrdering rowOrdering)
throws StandardException
{
optimizer.trace(Optimizer.CALLING_ON_JOIN_NODE, 0, 0, 0.0, null);
// It's possible that a call to optimize the left/ri... |
private static final String WEEK_FROM_TODAY;
static {
Calendar cal = Calendar.getInstance();
// Make sure that we are not so close to midnight that TODAY might be yesterday before
// we are finished using it.
while( cal.get( Calendar.HOUR) == 23 && cal.get( Calendar.MINUTE) == 58... | private static final String WEEK_FROM_TODAY;
static {
Calendar cal = Calendar.getInstance();
// Make sure that we are not so close to midnight that TODAY might be yesterday before
// we are finished using it.
while( cal.get( Calendar.HOUR) == 23 && cal.get( Calendar.MINUTE) >= 58... |
private FieldsProducer buildIndex(Directory dir, IndexOptions maxAllowed, boolean allowPayloads) throws IOException {
SegmentInfo segmentInfo = new SegmentInfo(dir, Constants.LUCENE_MAIN_VERSION, "_0", 1+maxDocID, false, Codec.getDefault(), null, null);
int maxIndexOption = Arrays.asList(IndexOptions.values(... | private FieldsProducer buildIndex(Directory dir, IndexOptions maxAllowed, boolean allowPayloads) throws IOException {
SegmentInfo segmentInfo = new SegmentInfo(dir, Constants.LUCENE_MAIN_VERSION, "_0", 1+maxDocID, false, Codec.getDefault(), null, null);
int maxIndexOption = Arrays.asList(IndexOptions.values(... |
public int run(String[] args) throws Exception {
InformationGain job = new InformationGain();
ToolRunner.run(job, args);
informationGain = job.getInformationGain();
entropy = job.getEntropy();
informationGainRatio = informationGain / entropy;
return 0;
}
| public int run(String[] args) throws Exception {
InformationGain job = new InformationGain();
ToolRunner.run(getConf(), job, args);
informationGain = job.getInformationGain();
entropy = job.getEntropy();
informationGainRatio = informationGain / entropy;
return 0;
}
|
public static void clusterData(Configuration conf, Path input, Path clustersIn, Path output, DistanceMeasure measure,
double clusterClassificationThreshold, boolean runSequential) throws IOException, InterruptedException,
ClassNotFoundException {
if (log.isInfoEnabled()) {
log.info("Running... | public static void clusterData(Configuration conf, Path input, Path clustersIn, Path output, DistanceMeasure measure,
double clusterClassificationThreshold, boolean runSequential) throws IOException, InterruptedException,
ClassNotFoundException {
if (log.isInfoEnabled()) {
log.info("Running... |
public static String validateColumnFamily(String tablename, String cfName) throws InvalidRequestException
{
if (cfName.isEmpty())
{
throw new InvalidRequestException("non-empty columnfamily is required");
}
String cfType = DatabaseDescriptor.getColumnType(tablename, c... | public static String validateColumnFamily(String tablename, String cfName) throws InvalidRequestException
{
if (cfName.isEmpty())
{
throw new InvalidRequestException("non-empty columnfamily is required");
}
String cfType = DatabaseDescriptor.getColumnType(tablename, c... |
public static final String[] ENGLISH_STOP_WORDS = {
"a", "and", "are", "as", "at", "be", "but", "by",
"for", "if", "in", "into", "is", "it",
"no", "not", "of", "on", "or", "s", "such",
"t", "that", "the", "their", "then", "there", "these",
"they", "this", "to", "was", "will", "with"
};
| public static final String[] ENGLISH_STOP_WORDS = {
"a", "an", "and", "are", "as", "at", "be", "but", "by",
"for", "if", "in", "into", "is", "it",
"no", "not", "of", "on", "or", "s", "such",
"t", "that", "the", "their", "then", "there", "these",
"they", "this", "to", "was", "will", "with"
};
|
public void testEvaluate() throws Exception {
int nbrules = 100;
Random rng = RandomUtils.getRandom();
int target = 1;
// random rules
List<Rule> rules = new ArrayList<Rule>();
for (int index = 0; index < nbrules; index++) {
rules.add(new RandomRule(index, target, rng));
}
// d... | public void testEvaluate() throws Exception {
int nbrules = 100;
Random rng = RandomUtils.getRandom();
int target = 1;
// random rules
List<Rule> rules = new ArrayList<Rule>();
for (int index = 0; index < nbrules; index++) {
rules.add(new RandomRule(index, target, rng));
}
// d... |
public void testSet() throws Exception {
Path inpath = new Path("target/test-classes/wdbc");
FileSystem fs = FileSystem.get(inpath.toUri(), new Configuration());
DataSet dataset = FileInfoParser.parseFile(fs, inpath);
DataSet.initialize(dataset);
DataLine dl = new DataLine();
int lab... | public void testSet() throws Exception {
Path inpath = new Path(this.getClass().getResource("/wdbc/").getPath());
FileSystem fs = FileSystem.get(inpath.toUri(), new Configuration());
DataSet dataset = FileInfoParser.parseFile(fs, inpath);
DataSet.initialize(dataset);
DataLine dl = new DataLin... |
protected final void ensureOpen() throws AlreadyClosedException {
if (closed) {
throw new AlreadyClosedException("this FieldsReader is closed");
}
}
/**
* Closes the underlying {@link org.apache.lucene.store.IndexInput} streams, including any ones associated with a
* lazy implementation of a ... | protected final void ensureOpen() throws AlreadyClosedException {
if (closed) {
throw new AlreadyClosedException("this FieldsReader is closed");
}
}
/**
* Closes the underlying {@link org.apache.lucene.store.IndexInput} streams, including any ones associated with a
* lazy implementation of a ... |
public SchemaField getField(String fieldName) {
SchemaField f = getFieldOrNull(fieldName);
if (f != null) return f;
// Hmmm, default field could also be implemented with a dynamic field of "*".
// It would have to be special-cased and only used if nothing else matched.
/*** REMOVED -YCS
if ... | public SchemaField getField(String fieldName) {
SchemaField f = getFieldOrNull(fieldName);
if (f != null) return f;
// Hmmm, default field could also be implemented with a dynamic field of "*".
// It would have to be special-cased and only used if nothing else matched.
/*** REMOVED -YCS
if ... |
public static void copyFiles(File outDir, String suppFiles)
throws ClassNotFoundException, IOException
{
// suppFiles is a comma separated list of the files
StringTokenizer st = new StringTokenizer(suppFiles,",");
String scriptName = ""; // example: test/math.sql
InputStream is = null; // To ... | public static void copyFiles(File outDir, String suppFiles)
throws ClassNotFoundException, IOException
{
// suppFiles is a comma separated list of the files
StringTokenizer st = new StringTokenizer(suppFiles,",");
String scriptName = ""; // example: test/math.sql
InputStream is = null; // To ... |
public ExecRow getNextRowCore() throws StandardException {
ExecRow result = null;
DataValueDescriptor[] columns = null;
beginTime = getCurrentTimeMillis();
if ( isOpen )
{
/* We use a do/while loop to ensure that we continue down
* the duplicate chain, if one exists, until we find a
* ro... | public ExecRow getNextRowCore() throws StandardException {
ExecRow result = null;
DataValueDescriptor[] columns = null;
beginTime = getCurrentTimeMillis();
if ( isOpen )
{
/* We use a do/while loop to ensure that we continue down
* the duplicate chain, if one exists, until we find a
* ro... |
public void handle(Map<String, Object> record, String xpath) {
rows.add(readRow(record, xpath));
}
});
} catch (Exception e) {
String msg = "Parsing failed for xml, url:" + s + " rows processed:" + rows.size();
if (rows.size() > 0) msg += " las... | public void handle(Map<String, Object> record, String xpath) {
rows.add(readRow(record, xpath));
}
});
} catch (Exception e) {
String msg = "Parsing failed for xml, url:" + s + " rows processed:" + rows.size();
if (rows.size() > 0) msg += " las... |
public ColumnFamily filter(String cf, ColumnFamily columnFamily)
{
if (columnFamily == null)
return columnFamily;
String[] values = RowMutation.getColumnAndColumnFamily(cf);
ColumnFamily filteredCf = new ColumnFamily(columnFamily.name(), columnFamily.type());
if (values.length == 1 && !c... | public ColumnFamily filter(String cf, ColumnFamily columnFamily)
{
if (columnFamily == null)
return columnFamily;
String[] values = RowMutation.getColumnAndColumnFamily(cf);
ColumnFamily filteredCf = new ColumnFamily(columnFamily.name(), columnFamily.type());
if (values.length == 1 && !c... |
private void resolve(String key, ColumnFamily columnFamily)
{
ColumnFamily oldCf = columnFamilies_.get(key);
if ( oldCf != null )
{
int oldSize = oldCf.size();
int oldObjectCount = oldCf.getColumnCount();
oldCf.addColumns(columnFamily);
int ne... | private void resolve(String key, ColumnFamily columnFamily)
{
ColumnFamily oldCf = columnFamilies_.get(key);
if ( oldCf != null )
{
int oldSize = oldCf.size();
int oldObjectCount = oldCf.getColumnCount();
oldCf.addColumns(columnFamily);
int ne... |
public ColumnFamily filter(String cfNameParam, ColumnFamily columnFamily)
{
String[] values = RowMutation.getColumnAndColumnFamily(cfNameParam);
if ( columnFamily == null )
return columnFamily;
ColumnFamily filteredCf = new ColumnFamily(columnFamily.name(), columnFamily.type());
if... | public ColumnFamily filter(String cfNameParam, ColumnFamily columnFamily)
{
String[] values = RowMutation.getColumnAndColumnFamily(cfNameParam);
if ( columnFamily == null )
return columnFamily;
ColumnFamily filteredCf = new ColumnFamily(columnFamily.name(), columnFamily.type());
if... |
private static ColumnFamily resolveAndRemoveDeleted(List<ColumnFamily> columnFamilies) {
ColumnFamily cf = ColumnFamily.resolve(columnFamilies);
return removeDeleted(cf);
}
/*
This is complicated because we need to preserve deleted columns, supercolumns, and columnfamilies
until t... | private static ColumnFamily resolveAndRemoveDeleted(List<ColumnFamily> columnFamilies) {
ColumnFamily cf = ColumnFamily.resolve(columnFamilies);
return removeDeleted(cf);
}
/*
This is complicated because we need to preserve deleted columns, supercolumns, and columnfamilies
until t... |
public ColumnFamily filter(String cf, ColumnFamily columnFamily)
{
if ( columnFamily == null )
{
return columnFamily;
}
String[] values = RowMutation.getColumnAndColumnFamily(cf);
ColumnFamily filteredCf = new ColumnFamily(columnFamily.name(), columnFamily.type()... | public ColumnFamily filter(String cf, ColumnFamily columnFamily)
{
if ( columnFamily == null )
{
return columnFamily;
}
String[] values = RowMutation.getColumnAndColumnFamily(cf);
ColumnFamily filteredCf = new ColumnFamily(columnFamily.name(), columnFamily.type()... |
public void testMissingSubcolumn() {
byte[] val = "sample value".getBytes();
SuperColumn sc = new SuperColumn("sc1");
sc.addColumn("col1", new Column("col1",val,1L));
assertNotNull(sc.getSubColumn("col1"));
assertNull(sc.getSubColumn("col2"));
}
| public void testMissingSubcolumn() {
byte[] val = "sample value".getBytes();
SuperColumn sc = new SuperColumn("sc1");
sc.addColumn(new Column("col1",val,1L));
assertNotNull(sc.getSubColumn("col1"));
assertNull(sc.getSubColumn("col2"));
}
|
public void testDiffSuperColumn()
{
SuperColumn sc1 = new SuperColumn("one");
sc1.addColumn("subcolumn", new Column("subcolumn", "A".getBytes(), 0));
SuperColumn sc2 = new SuperColumn("one");
sc2.markForDeleteAt(0, 0);
SuperColumn scDiff = (SuperColumn)sc1.diff(sc2);
... | public void testDiffSuperColumn()
{
SuperColumn sc1 = new SuperColumn("one");
sc1.addColumn(new Column("subcolumn", "A".getBytes(), 0));
SuperColumn sc2 = new SuperColumn("one");
sc2.markForDeleteAt(0, 0);
SuperColumn scDiff = (SuperColumn)sc1.diff(sc2);
assertE... |
private static void processCLIStmt(String query)
{
try
{
cliClient_.executeCLIStmt(query);
}
catch (InvalidRequestException ire)
{
css_.err.println(ire.why);
if (css_.debug)
ire.printStackTrace(css_.err);
... | private static void processCLIStmt(String query)
{
try
{
cliClient_.executeCLIStmt(query);
}
catch (InvalidRequestException ire)
{
css_.err.println(ire.why);
if (css_.debug)
ire.printStackTrace(css_.err);
... |
public Set<Content> getExportService() {
if (_exportServices == null) {
_exportServices = getContentSetFromHeader (_attributes, Constants.EXPORT_SERVICE);
}
return _exportPackages;
}
| public Set<Content> getExportService() {
if (_exportServices == null) {
_exportServices = getContentSetFromHeader (_attributes, Constants.EXPORT_SERVICE);
}
return _exportServices;
}
|
String SET_STREAM_INEXACT_LENGTH_DATA = "XJ023.S";
/*
Derby - Class org.apache.derby.iapi.reference.SQLState
Copyright 1999, 2004 The Apache Software Foundation or its licensors, as applicable.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance... | String SET_STREAM_INEXACT_LENGTH_DATA = "XJ023.S";
/*
Derby - Class org.apache.derby.iapi.reference.SQLState
Copyright 1999, 2004 The Apache Software Foundation or its licensors, as applicable.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance... |
public State<T> mutate() {
double sum = 0;
for (double v : step) {
sum += v * v;
}
sum = Math.sqrt(sum);
double lambda = 1 + gen.nextGaussian();
State<T> r = this.copy();
double magnitude = 0.9 * omni + sum / 10;
r.omni = magnitude * -Math.log(1 - gen.nextDouble());
for (int... | public State<T> mutate() {
double sum = 0;
for (double v : step) {
sum += v * v;
}
sum = Math.sqrt(sum);
double lambda = 1 + gen.nextGaussian();
State<T> r = this.copy();
double magnitude = 0.9 * omni + sum / 10;
r.omni = magnitude * -Math.log(1 - gen.nextDouble());
for (int... |
String getProperty(String key) throws IOException;
/*
* Copyright (c) OSGi Alliance (2009, 2010). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://... | String getProperty(String key) throws IOException;
/*
* Copyright (c) OSGi Alliance (2009, 2010). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://... |
protected void finalize()
{
assert references.get() == 0;
assert peer == 0;
}
| protected void finalize()
{
assert references.get() <= 0;
assert peer == 0;
}
|
public void reinit(boolean eraseIndex) throws Exception {
// cleanup index
if (indexWriter!=null) {
indexWriter.close();
indexWriter = null;
}
if (indexReader!=null) {
indexReader.close();
indexReader = null;
}
if (directory!=null) {
directory.close();
}
... | public void reinit(boolean eraseIndex) throws Exception {
// cleanup index
if (indexWriter!=null) {
indexWriter.close();
indexWriter = null;
}
if (indexReader!=null) {
indexReader.close();
indexReader = null;
}
if (directory!=null) {
directory.close();
}
... |
public Query rewrite(IndexReader reader) throws IOException {
final Query childRewrite = childQuery.rewrite(reader);
if (childRewrite != childQuery) {
Query rewritten = new ToParentBlockJoinQuery(childQuery,
childRewrite,
parentsFilter,
... | public Query rewrite(IndexReader reader) throws IOException {
final Query childRewrite = childQuery.rewrite(reader);
if (childRewrite != childQuery) {
Query rewritten = new ToParentBlockJoinQuery(origChildQuery,
childRewrite,
parentsFilter,... |
public Collection<String> files(Directory dir, boolean includeSegmentsFile) throws IOException {
HashSet<String> files = new HashSet<String>();
if (includeSegmentsFile) {
files.add(getCurrentSegmentFileName());
}
final int size = size();
for(int i=0;i<size;i++) {
final SegmentInfo info... | public Collection<String> files(Directory dir, boolean includeSegmentsFile) throws IOException {
HashSet<String> files = new HashSet<String>();
if (includeSegmentsFile) {
files.add(getCurrentSegmentFileName());
}
final int size = size();
for(int i=0;i<size;i++) {
final SegmentInfo info... |
public void checkDistributed(ResponseBuilder rb) {
SolrQueryRequest req = rb.req;
SolrParams params = req.getParams();
rb.isDistrib = params.getBool("distrib", req.getCore().getCoreDescriptor()
.getCoreContainer().isZooKeeperAware());
String shards = params.get(ShardParams.SHARDS);
// fo... | public void checkDistributed(ResponseBuilder rb) {
SolrQueryRequest req = rb.req;
SolrParams params = req.getParams();
rb.isDistrib = params.getBool("distrib", req.getCore().getCoreDescriptor()
.getCoreContainer().isZooKeeperAware());
String shards = params.get(ShardParams.SHARDS);
// fo... |
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 void load(String dir, InputStream cfgis)
throws ParserConfigurationException, IOException, SAXException {
this.loader = new SolrResourceLoader(dir);
solrHome = loader.getInstanceDir();
try {
Config cfg = new Config(loader, null, cfgis, null);
String dcoreName = cfg.get("solr/@defa... | public void load(String dir, InputStream cfgis)
throws ParserConfigurationException, IOException, SAXException {
this.loader = new SolrResourceLoader(dir);
solrHome = loader.getInstanceDir();
try {
Config cfg = new Config(loader, null, cfgis, null);
String dcoreName = cfg.get("solr/@defa... |
private StopFilter(Version matchVersion, boolean enablePositionIncrements, TokenStream input, Set<?> stopWords, boolean ignoreCase){
super(input);
this.stopWords = CharArraySet.unmodifiableSet(new CharArraySet(matchVersion, stopWords, ignoreCase));
this.enablePositionIncrements = enablePositionIncrements;... | private StopFilter(Version matchVersion, boolean enablePositionIncrements, TokenStream input, Set<?> stopWords, boolean ignoreCase){
super(input);
this.stopWords = stopWords instanceof CharArraySet ? (CharArraySet)stopWords : new CharArraySet(matchVersion, stopWords, ignoreCase);
this.enablePositionIncrem... |
public void testTokenizeDocuments() throws Exception {
Configuration configuration = new Configuration();
FileSystem fs = FileSystem.get(configuration);
Path input = new Path(getTestTempDirPath(), "inputDir");
Path output = new Path(getTestTempDirPath(), "outputDir");
String documentId1 = "123";
... | public void testTokenizeDocuments() throws Exception {
Configuration configuration = new Configuration();
FileSystem fs = FileSystem.get(configuration);
Path input = new Path(getTestTempDirPath(), "inputDir");
Path output = new Path(getTestTempDirPath(), "outputDir");
String documentId1 = "123";
... |
public void reload(String name) throws ParserConfigurationException, IOException, SAXException {
name= checkDefault(name);
SolrCore core;
synchronized(cores) {
core = cores.get(name);
}
if (core == null)
throw new SolrException( SolrException.ErrorCode.BAD_REQUEST, "No such core: " + n... | public void reload(String name) throws ParserConfigurationException, IOException, SAXException {
name= checkDefault(name);
SolrCore core;
synchronized(cores) {
core = cores.get(name);
}
if (core == null)
throw new SolrException( SolrException.ErrorCode.BAD_REQUEST, "No such core: " + n... |
private void putVal(String name, Object val, Map map) {
if(val == null) map.remove(name);
else entitySession.put(name, val);
}
| private void putVal(String name, Object val, Map map) {
if(val == null) map.remove(name);
else map.put(name, val);
}
|
private Map<Method, List<Object>> findMatchingMethods(Class type, String name, boolean instance, List<Object> args, List<ReifiedType> types) {
Map<Method, List<Object>> matches = new HashMap<Method, List<Object>>();
// Get constructors
List<Method> methods = getPublicMethods(type);
/... | private Map<Method, List<Object>> findMatchingMethods(Class type, String name, boolean instance, List<Object> args, List<ReifiedType> types) {
Map<Method, List<Object>> matches = new HashMap<Method, List<Object>>();
// Get constructors
List<Method> methods = new ArrayList<Method>(Arrays.asLi... |
protected Reader openStream(File file) throws FileNotFoundException,
UnsupportedEncodingException {
if (encoding == null) {
return new InputStreamReader(new FileInputStream(file));
} else {
return new InputStreamReader(new FileInputStream(file), encoding);
}
}
| protected Reader openStream(File file) throws FileNotFoundException,
UnsupportedEncodingException {
if (encoding == null) {
return new InputStreamReader(new FileInputStream(file), "UTF-8");
} else {
return new InputStreamReader(new FileInputStream(file), encoding);
}
}
|
private Reader getReader(Blob blob)
throws SQLException, UnsupportedEncodingException {
if (encoding == null) {
return (new InputStreamReader(blob.getBinaryStream()));
} else {
return (new InputStreamReader(blob.getBinaryStream(), encoding));
}
}
| private Reader getReader(Blob blob)
throws SQLException, UnsupportedEncodingException {
if (encoding == null) {
return (new InputStreamReader(blob.getBinaryStream(), "UTF-8"));
} else {
return (new InputStreamReader(blob.getBinaryStream(), encoding));
}
}
|
public final void weave(WovenClass wovenClass) {
Bundle b = wovenClass.getBundleWiring().getBundle();
if(b.getBundleId() == 0 ||
b.getSymbolicName().startsWith("org.apache.aries.proxy") ||
b.getSymbolicName().startsWith("org.apache.aries.util")) {
return;
}
if (!isEn... | public final void weave(WovenClass wovenClass) {
Bundle b = wovenClass.getBundleWiring().getBundle();
if(b.getBundleId() == 0 ||
b.getSymbolicName().startsWith("org.apache.aries.proxy") ||
b.getSymbolicName().startsWith("org.apache.aries.util")) {
return;
}
if (!isEn... |
private boolean done = false;
/**
* Construct an {@link InterfaceCombiningClassAdapter} to combine the supplied
* interfaces into a class with the supplied name using the supplied classloader
* @param className
* @param loader
* @param interfaces
*/
InterfaceCombiningClassAdapter(String classNa... | private boolean done = false;
/**
* Construct an {@link InterfaceCombiningClassAdapter} to combine the supplied
* interfaces into a class with the supplied name using the supplied classloader
* @param className
* @param loader
* @param interfaces
*/
InterfaceCombiningClassAdapter(String classNa... |
private void deleteOldBackups(int numberToKeep) {
File[] files = new File(snapDir).listFiles();
List<OldBackupDirectory> dirs = new ArrayList<OldBackupDirectory>();
for(File f : files) {
OldBackupDirectory obd = new OldBackupDirectory(f);
if(obd.dir != null) {
dirs.add(obd);
}
... | private void deleteOldBackups(int numberToKeep) {
File[] files = new File(snapDir).listFiles();
List<OldBackupDirectory> dirs = new ArrayList<OldBackupDirectory>();
for(File f : files) {
OldBackupDirectory obd = new OldBackupDirectory(f);
if(obd.dir != null) {
dirs.add(obd);
}
... |
public ColumnFamilyStoreMBeanIterator(MBeanServerConnection mbeanServerConn)
throws MalformedObjectNameException, NullPointerException, IOException
{
ObjectName query = new ObjectName("org.apache.cassandra.db:type=ColumnFamilyStores,*");
resIter = mbeanServerConn.queryNames(query, null).iter... | public ColumnFamilyStoreMBeanIterator(MBeanServerConnection mbeanServerConn)
throws MalformedObjectNameException, NullPointerException, IOException
{
ObjectName query = new ObjectName("org.apache.cassandra.db:type=ColumnFamilies,*");
resIter = mbeanServerConn.queryNames(query, null).iterator... |
private final static String STORAGE_CONF_FILE = "storage-conf.xml";
/**
* Try the storage-config system property, and then inspect the classpath.
*/
static String getStorageConfigPath()
{
String scp = System.getProperty("storage-config") + File.separator + STORAGE_CONF_FILE;
i... | private final static String STORAGE_CONF_FILE = "storage-conf.xml";
/**
* Try the storage-config system property, and then inspect the classpath.
*/
static String getStorageConfigPath()
{
String scp = System.getProperty("storage-config") + File.separator + STORAGE_CONF_FILE;
i... |
public final boolean incrementToken() throws IOException {
assert !enableChecks || (streamState == State.RESET || streamState == State.INCREMENT)
: "incrementToken() called while in wrong state: " + streamState;
clearAttributes();
for (;;) {
int startOffset = off;
... | public final boolean incrementToken() throws IOException {
assert !enableChecks || (streamState == State.RESET || streamState == State.INCREMENT)
: "incrementToken() called while in wrong state: " + streamState;
clearAttributes();
for (;;) {
int startOffset = off;
... |
protected boolean isTokenChar(int c) {
throw new UnsupportedOperationException("since LUCENE_3_1 subclasses of CharTokenizer must implement isTokenChar(int)");
}
| protected boolean isTokenChar(int c) {
throw new UnsupportedOperationException("since LUCENE_31 subclasses of CharTokenizer must implement isTokenChar(int)");
}
|
private static boolean testSelect(Connection conn)
{
Statement s;
boolean passed = true;
System.out.println("Test AIjdbc:select from base table");
try
{
s = conn.createStatement();
ResultSet rs = s.executeQuery("select x,z from tab1");
ResultSetMetaData rsmd = rs.getMetaData();
if (rsmd.g... | private static boolean testSelect(Connection conn)
{
Statement s;
boolean passed = true;
System.out.println("Test AIjdbc:select from base table");
try
{
s = conn.createStatement();
ResultSet rs = s.executeQuery("select x,z from tab1");
ResultSetMetaData rsmd = rs.getMetaData();
if (rsmd.g... |
public QueryResultKey(Query query, List<Query> filters, Sort sort, int nc_flags) {
this.query = query;
this.sort = sort;
this.filters = filters;
this.nc_flags = nc_flags;
int h = query.hashCode();
if (filters != null) {
for (Query filt : filters)
h += filters.hashCode();
}
... | public QueryResultKey(Query query, List<Query> filters, Sort sort, int nc_flags) {
this.query = query;
this.sort = sort;
this.filters = filters;
this.nc_flags = nc_flags;
int h = query.hashCode();
if (filters != null) {
for (Query filt : filters)
h += filt.hashCode();
}
... |
public static Path buildClusters(Configuration conf,
Path input,
Path clustersIn,
Path output,
DistanceMeasure measure,
double convergenceDelta... | public static Path buildClusters(Configuration conf,
Path input,
Path clustersIn,
Path output,
DistanceMeasure measure,
double convergenceDelta... |
private static void run(Path input, Path output, DistanceMeasure measure,
double t1, double t2) throws Exception{
Path directoryContainingConvertedInput = new Path(output,
DIRECTORY_CONTAINING_CONVERTED_INPUT);
InputDriver.runJob(input, directoryContainingConvertedInput,
"org.apache.maho... | private static void run(Path input, Path output, DistanceMeasure measure,
double t1, double t2) throws Exception{
Path directoryContainingConvertedInput = new Path(output,
DIRECTORY_CONTAINING_CONVERTED_INPUT);
InputDriver.runJob(input, directoryContainingConvertedInput,
"org.apache.maho... |
public static void run(Configuration conf,
Path input,
Path output,
DistanceMeasure measure,
IKernelProfile kernelProfile,
double t1,
double t2,
... | public static void run(Configuration conf,
Path input,
Path output,
DistanceMeasure measure,
IKernelProfile kernelProfile,
double t1,
double t2,
... |
public boolean referencesSessionSchema()
throws StandardException
{
int size = size();
for (int index = 0; index < size; index++)
{
SubqueryNode subqueryNode;
subqueryNode = (SubqueryNode) elementAt(index);
if (subqueryNode.getResultSet().referencesSessionSchema())
{
return true;
}
}
... | public boolean referencesSessionSchema()
throws StandardException
{
int size = size();
for (int index = 0; index < size; index++)
{
SubqueryNode subqueryNode;
subqueryNode = (SubqueryNode) elementAt(index);
if (subqueryNode.referencesSessionSchema())
{
return true;
}
}
return false;
... |
public String getFlushPath()
{
long guessedSize = 2 * DatabaseDescriptor.getMemtableThroughput() * 1024*1024; // 2* adds room for keys, column indexes
String location = DatabaseDescriptor.getDataFileLocationForTable(table.name, guessedSize);
if (location == null)
throw new Ru... | public String getFlushPath()
{
long guessedSize = 2 * metadata.memtableThroughputInMb * 1024*1024; // 2* adds room for keys, column indexes
String location = DatabaseDescriptor.getDataFileLocationForTable(table.name, guessedSize);
if (location == null)
throw new RuntimeExcept... |
public static final String VERSION = "19.1.0";
} | public static final String VERSION = "19.2.0";
} |
public void testCli() throws IOException, TTransportException, ConfigurationException
{
setup();
// new error/output streams for CliSessionState
ByteArrayOutputStream errStream = new ByteArrayOutputStream();
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
... | public void testCli() throws IOException, TTransportException, ConfigurationException
{
setup();
// new error/output streams for CliSessionState
ByteArrayOutputStream errStream = new ByteArrayOutputStream();
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
... |
private static Exclusions[] rawExcludables = new Exclusions[]
{
new Exclusions
(
java.sql.Connection.class,
new MD[]
{
new MD( "createArray", new Class[] { String.class, Object[].class } ),
new MD( "createNClob", new Class[] { } ),
new MD( "createSQLXML", new Class[] { } ),
... | private static Exclusions[] rawExcludables = new Exclusions[]
{
new Exclusions
(
java.sql.Connection.class,
new MD[]
{
new MD( "createArrayOf", new Class[] { String.class, Object[].class } ),
new MD( "createNClob", new Class[] { } ),
new MD( "createSQLXML", new Class[] { } )... |
public List<SegToken> makeIndex() {
List<SegToken> result = new ArrayList<SegToken>();
int s = -1, count = 0, size = tokenListTable.size();
List<SegToken> tokenList;
short index = 0;
while (count < size) {
if (isStartExist(s)) {
tokenList = tokenListTable.get(s);
for (SegToke... | public List<SegToken> makeIndex() {
List<SegToken> result = new ArrayList<SegToken>();
int s = -1, count = 0, size = tokenListTable.size();
List<SegToken> tokenList;
int index = 0;
while (count < size) {
if (isStartExist(s)) {
tokenList = tokenListTable.get(s);
for (SegToken ... |
public DataTypeDescriptor getTypeServices()
{
DataTypeDescriptor dtd = super.getTypeServices();
if( dtd == null && source != null)
{
dtd = source.getTypeServices();
if( dtd != null)
setType( dtd);
}
return dtd;
} // end of getTypeServ... | public DataTypeDescriptor getTypeServices() throws StandardException
{
DataTypeDescriptor dtd = super.getTypeServices();
if( dtd == null && source != null)
{
dtd = source.getTypeServices();
if( dtd != null)
setType( dtd);
}
return dtd;
... |
public Visitable visit(Visitable node) throws StandardException
{
if (node instanceof ValueNode)
{
if (ignoreParameters && ((ValueNode)node).isParameterNode())
return node;
if (((ValueNode)node).getOrderableVariantType() <= variantType)
{
hasVariant = true;
}
}
return node;
}
| public Visitable visit(Visitable node) throws StandardException
{
if (node instanceof ValueNode)
{
if (ignoreParameters && ((ValueNode)node).requiresTypeFromContext())
return node;
if (((ValueNode)node).getOrderableVariantType() <= variantType)
{
hasVariant = true;
}
}
return node;
}... |
private void deferredBindExpressions(FromList fromListParam)
throws StandardException
{
/* Bind the expressions in the join clause */
subqueryList = (SubqueryList) getNodeFactory().getNode(
C_NodeTypes.SUBQUERY_LIST,
getContextManager());
aggregateVector = new Vector();
/* ON clause... | private void deferredBindExpressions(FromList fromListParam)
throws StandardException
{
/* Bind the expressions in the join clause */
subqueryList = (SubqueryList) getNodeFactory().getNode(
C_NodeTypes.SUBQUERY_LIST,
getContextManager());
aggregateVector = new Vector();
/* ON clause... |
public CostEstimate estimateCost(OptimizablePredicateList predList,
ConglomerateDescriptor cd,
CostEstimate outerCost,
Optimizer optimizer,
RowOrdering rowOrdering)
throws StandardException
{
double cost;
boolean statisticsForTable = false;
boolean statisticsForConglomerat... | public CostEstimate estimateCost(OptimizablePredicateList predList,
ConglomerateDescriptor cd,
CostEstimate outerCost,
Optimizer optimizer,
RowOrdering rowOrdering)
throws StandardException
{
double cost;
boolean statisticsForTable = false;
boolean statisticsForConglomerat... |
public void init(
Object columnName,
Object tableName,
Object dts)
{
this.columnName = (String) columnName;
this.tableName = (TableName) tableName;
setType((DataTypeDescriptor) dts);
}
| public void init(
Object columnName,
Object tableName,
Object dts) throws StandardException
{
this.columnName = (String) columnName;
this.tableName = (TableName) tableName;
setType((DataTypeDescriptor) dts);
}
|
public ResultSetNode genProjectRestrict(int origFromListSize)
throws StandardException
{
boolean eliminateSort = false;
PredicateList restrictionList;
ResultColumnList prRCList;
ResultSetNode prnRSN;
prnRSN = (ResultSetNode) getNodeFactory().getNode(
C_NodeTypes.PROJECT_RESTRICT_NODE,
... | public ResultSetNode genProjectRestrict(int origFromListSize)
throws StandardException
{
boolean eliminateSort = false;
PredicateList restrictionList;
ResultColumnList prRCList;
ResultSetNode prnRSN;
prnRSN = (ResultSetNode) getNodeFactory().getNode(
C_NodeTypes.PROJECT_RESTRICT_NODE,
... |
protected BytesRef getDocGroupValue(int doc) {
final int ord = index.getOrd(doc);
return ord == 0 ? null : index.lookup(ord, scratchBytesRef);
}
| protected BytesRef getDocGroupValue(int doc) {
final int ord = index.getOrd(doc);
return ord == -1 ? null : index.lookup(ord, scratchBytesRef);
}
|
public static BytesRef analyzeMultiTerm(String field, String part, Analyzer analyzerIn) {
if (part == null) return null;
TokenStream source;
try {
source = analyzerIn.tokenStream(field, new StringReader(part));
source.reset();
} catch (IOException e) {
throw new SolrException(SolrEx... | public static BytesRef analyzeMultiTerm(String field, String part, Analyzer analyzerIn) {
if (part == null || analyzerIn == null) return null;
TokenStream source;
try {
source = analyzerIn.tokenStream(field, new StringReader(part));
source.reset();
} catch (IOException e) {
throw ne... |
public void testDelete() throws IOException {
Document docToDelete = new Document();
DocHelper.setupDoc(docToDelete);
SegmentInfo info = DocHelper.writeDoc(dir, docToDelete);
SegmentReader deleteReader = SegmentReader.get(false, info, IndexReader.DEFAULT_TERMS_INDEX_DIVISOR);
assertTrue(deleteRead... | public void testDelete() throws IOException {
Document docToDelete = new Document();
DocHelper.setupDoc(docToDelete);
SegmentInfo info = DocHelper.writeDoc(dir, docToDelete);
SegmentReader deleteReader = SegmentReader.get(false, info, IndexReader.DEFAULT_TERMS_INDEX_DIVISOR);
assertTrue(deleteRead... |
public void reSetNorms(String field) throws IOException {
String fieldName = StringHelper.intern(field);
int[] termCounts = new int[0];
IndexReader reader = IndexReader.open(dir, false);
try {
termCounts = new int[reader.maxDoc()];
Bits delDocs = MultiFields.getDeletedDocs(reader);
... | public void reSetNorms(String field) throws IOException {
String fieldName = StringHelper.intern(field);
int[] termCounts = new int[0];
IndexReader reader = IndexReader.open(dir, false);
try {
termCounts = new int[reader.maxDoc()];
Bits delDocs = MultiFields.getDeletedDocs(reader);
... |
public int compare(byte[] o1, byte[] o2)
{
if (o1.length == 0)
{
return o2.length == 0 ? 0 : -1;
}
if (o2.length == 0)
{
return 1;
}
long L1 = ByteBuffer.wrap(o1).order(ByteOrder.LITTLE_ENDIAN).getLong();
long L2 = ByteBuff... | public int compare(byte[] o1, byte[] o2)
{
if (o1.length == 0)
{
return o2.length == 0 ? 0 : -1;
}
if (o2.length == 0)
{
return 1;
}
long L1 = ByteBuffer.wrap(o1).order(ByteOrder.LITTLE_ENDIAN).getLong();
long L2 = ByteBuff... |
public void doVerb(Message message)
{
byte[] body = message.getMessageBody();
try
{
DataInputBuffer bufIn = new DataInputBuffer();
bufIn.reset(body, body.length);
/* Deserialize to get the token for this endpoint. */
MembershipClea... | public void doVerb(Message message)
{
byte[] body = message.getMessageBody();
try
{
DataInputBuffer bufIn = new DataInputBuffer();
bufIn.reset(body, body.length);
/* Deserialize to get the token for this endpoint. */
MembershipClea... |
private void doReadRepair() throws IOException
{
IResponseResolver<Row> readResponseResolver = new ReadResponseResolver();
/* Add the local storage endpoint to the replicas_ list */
replicas_.add(StorageService.getLocalStorageEndPoint());
IAsyncCallback responseHandler = new DataRepair... | private void doReadRepair() throws IOException
{
IResponseResolver<Row> readResponseResolver = new ReadResponseResolver();
/* Add the local storage endpoint to the replicas_ list */
replicas_.add(StorageService.getLocalStorageEndPoint());
IAsyncCallback responseHandler = new DataRepair... |
sb.append("termIndexInterval=").append(getTermIndexInterval()).append("\n"); // TODO: this should be private to the codec, not settable here
sb.append("delPolicy=").append(getIndexDeletionPolicy().getClass().getName()).append("\n");
IndexCommit commit = getIndexCommit();
sb.append("commit=").append(comm... | sb.append("termIndexInterval=").append(getTermIndexInterval()).append("\n"); // TODO: this should be private to the codec, not settable here
sb.append("delPolicy=").append(getIndexDeletionPolicy().getClass().getName()).append("\n");
IndexCommit commit = getIndexCommit();
sb.append("commit=").append(comm... |
public SpanNotQuery(SpanQuery include, SpanQuery exclude, int pre, int post) {
this.include = include;
this.exclude = exclude;
this.pre = (pre >=0) ? pre : 0;
this.post = (post >= 0) ? post : 0;
if (!include.getField().equals(exclude.getField()))
throw new IllegalArgumentException("Clauses ... | public SpanNotQuery(SpanQuery include, SpanQuery exclude, int pre, int post) {
this.include = include;
this.exclude = exclude;
this.pre = (pre >=0) ? pre : 0;
this.post = (post >= 0) ? post : 0;
if (include.getField() != null && exclude.getField() != null && !include.getField().equals(exclude.get... |
public void doVerb(Message message)
{
List<String> keys;
try
{
RangeCommand command = RangeCommand.read(message);
Table table = Table.open(command.table);
keys = table.getKeyRange(command.startWith, command.stopAt, command.maxResults);
}
... | public void doVerb(Message message)
{
List<String> keys;
try
{
RangeCommand command = RangeCommand.read(message);
Table table = Table.open(command.table);
keys = table.getKeyRange(command.startWith, command.stopAt, command.maxResults);
}
... |
public void testLuceneConstantVersion() throws IOException {
// common-build.xml sets lucene.version
final String version = System.getProperty("lucene.version");
assertNotNull( "null version", version);
assertTrue("Invalid version: "+version,
version.equals(Constants.LUCENE_MAIN_VERSION... | public void testLuceneConstantVersion() throws IOException {
// common-build.xml sets lucene.version
final String version = System.getProperty("lucene.version");
assertNotNull( "null version", version);
assertTrue("Invalid version: "+version,
version.equals(Constants.LUCENE_MAIN_VERSION... |
public void testFilterIndexReader() throws Exception {
Directory directory = newDirectory();
IndexWriter writer = new IndexWriter(directory, newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer()));
Document d1 = new Document();
d1.add(newField("default","one two", Field.Store.YES, Field.Index... | public void testFilterIndexReader() throws Exception {
Directory directory = newDirectory();
IndexWriter writer = new IndexWriter(directory, newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer()));
Document d1 = new Document();
d1.add(newField("default","one two", Field.Store.YES, Field.Index... |
private static boolean isConverged(String filePath, JobConf conf, FileSystem fs)
throws IOException {
Path outPart = new Path(filePath);
SequenceFile.Reader reader = new SequenceFile.Reader(fs, outPart, conf);
Text key = new Text();
Text value = new Text();
boolean converged = true;
whil... | private static boolean isConverged(String filePath, JobConf conf, FileSystem fs)
throws IOException {
Path outPart = new Path(filePath);
SequenceFile.Reader reader = new SequenceFile.Reader(fs, outPart, conf);
Text key = new Text();
Text value = new Text();
boolean converged = true;
whil... |
public ColumnFamily getColumnFamily(QueryFilter filter, int gcBefore) throws IOException
{
assert columnFamily_.equals(filter.getColumnFamilyName());
long start = System.currentTimeMillis();
// if we are querying subcolumns of a supercolumn, fetch the supercolumn with NQF, then filter ... | public ColumnFamily getColumnFamily(QueryFilter filter, int gcBefore) throws IOException
{
assert columnFamily_.equals(filter.getColumnFamilyName());
long start = System.currentTimeMillis();
// if we are querying subcolumns of a supercolumn, fetch the supercolumn with NQF, then filter ... |
public SSTableNamesIterator(SSTableReader ssTable, String key, SortedSet<byte[]> columnNames) throws IOException
{
assert columnNames != null;
this.columns = columnNames;
DecoratedKey decoratedKey = ssTable.getPartitioner().decorateKey(key);
FileDataInput file = ssTable.getFile... | public SSTableNamesIterator(SSTableReader ssTable, String key, SortedSet<byte[]> columnNames) throws IOException
{
assert columnNames != null;
this.columns = columnNames;
DecoratedKey decoratedKey = ssTable.getPartitioner().decorateKey(key);
FileDataInput file = ssTable.getFile... |
private static AdaptiveLogisticRegression.TrainingExample getExample(int i, Random gen, Vector beta) {
Vector data = new DenseVector(200);
for (Vector.Element element : data) {
element.set(gen.nextDouble() < 0.3 ? 1 : 0);
}
double p = 1 / (1 + Math.exp(1.5 - data.dot(beta)));
int target = ... | private static AdaptiveLogisticRegression.TrainingExample getExample(int i, Random gen, Vector beta) {
Vector data = new DenseVector(200);
for (Vector.Element element : data) {
element.set(gen.nextDouble() < 0.3 ? 1 : 0);
}
double p = 1 / (1 + Math.exp(1.5 - data.dot(beta)));
int target = ... |
public static boolean isBootstrapped()
{
Table table = Table.open(Table.SYSTEM_TABLE);
QueryFilter filter = QueryFilter.getNamesFilter(decorate(BOOTSTRAP_KEY),
new QueryPath(STATUS_CF),
... | public static boolean isBootstrapped()
{
Table table = Table.open(Table.SYSTEM_TABLE);
QueryFilter filter = QueryFilter.getNamesFilter(decorate(BOOTSTRAP_KEY),
new QueryPath(STATUS_CF),
... |
public void loadClass() throws Exception {
Class clz = DocBuilder.loadClass("RegexTransformer");
Assert.assertNotNull(clz);
}
| public void loadClass() throws Exception {
Class clz = DocBuilder.loadClass("RegexTransformer", null);
Assert.assertNotNull(clz);
}
|
public SolrCore getSolrCore() {
return dataImporter.getCore();
}
| public SolrCore getSolrCore() {
return dataImporter == null ? null : dataImporter.getCore();
}
|
public void readFromXml(Element e) {
List<Element> n = getChildNodes(e, "document");
if (!n.isEmpty())
documents = new ArrayList<Document>();
for (Element element : n)
documents.add(new Document(element));
n = getChildNodes(e, SCRIPT);
if (!n.isEmpty()) {
script = new Script(n.g... | public void readFromXml(Element e) {
List<Element> n = getChildNodes(e, "document");
if (!n.isEmpty())
documents = new ArrayList<Document>();
for (Element element : n)
documents.add(new Document(element));
n = getChildNodes(e, SCRIPT);
if (!n.isEmpty()) {
script = new Script(n.g... |
public boolean add(Transformer transformer) {
return super.add(DebugLogger.wrapTransformer(transformer));
}
};
for (String aTransArr : transArr) {
String trans = aTransArr.trim();
if (trans.startsWith("script:")) {
String functionName = trans.substring("script:".length())... | public boolean add(Transformer transformer) {
return super.add(DebugLogger.wrapTransformer(transformer));
}
};
for (String aTransArr : transArr) {
String trans = aTransArr.trim();
if (trans.startsWith("script:")) {
String functionName = trans.substring("script:".length())... |
private String getCollation(String origQuery,
List<SpellCheckCorrection> corrections) {
StringBuilder collation = new StringBuilder(origQuery);
int offset = 0;
String corr = "";
for(int i=0 ; i<corrections.size() ; i++) {
SpellCheckCorrection correction = correction... | private String getCollation(String origQuery,
List<SpellCheckCorrection> corrections) {
StringBuilder collation = new StringBuilder(origQuery);
int offset = 0;
String corr = "";
for(int i=0 ; i<corrections.size() ; i++) {
SpellCheckCorrection correction = correction... |
public void testGetTypeInfo() throws SQLException
{
// Client returns BOOLEAN type from the engine as SMALLINT
int BOOLEAN = Types.BOOLEAN;
if (usingDerbyNetClient())
BOOLEAN = Types.SMALLINT;
String[] JDBC_COLUMN_NAMES = new String[] {
... | public void testGetTypeInfo() throws SQLException
{
// Client returns BOOLEAN type from the engine as SMALLINT
int BOOLEAN = Types.BOOLEAN;
if (usingDerbyNetClient())
BOOLEAN = Types.SMALLINT;
String[] JDBC_COLUMN_NAMES = new String[] {
... |
public long getPosition(DecoratedKey decoratedKey, Operator op)
{
// first, check bloom filter
if (op == Operator.EQ && !bf.isPresent(partitioner.convertToDiskFormat(decoratedKey)))
return -1;
// next, the key cache
Pair<Descriptor, DecoratedKey> unifiedKey = new Pai... | public long getPosition(DecoratedKey decoratedKey, Operator op)
{
// first, check bloom filter
if (op == Operator.EQ && !bf.isPresent(decoratedKey.key))
return -1;
// next, the key cache
Pair<Descriptor, DecoratedKey> unifiedKey = new Pair<Descriptor, DecoratedKey>(d... |
public String getTableName()
{
return cfs.getTable().name;
}
| public String getTableName()
{
return cfs.table.name;
}
|
public static void largeTest(String[] args) throws Exception{
System.out.println("connecting");
Connection conn = connectAndCreate("LOBdb");
Statement s = conn.createStatement();
try {
System.out.println("dropping");
s.executeUpdate("DROP TABLE atable");
} catch (Exception e) {
}
System.out.print... | public static void largeTest(String[] args) throws Exception{
System.out.println("connecting");
Connection conn = connectAndCreate("LOBdb");
Statement s = conn.createStatement();
try {
System.out.println("dropping");
s.executeUpdate("DROP TABLE atable");
} catch (Exception e) {
}
System.out.print... |
final private void handleMergeException(Throwable t, MergePolicy.OneMerge merge) throws IOException {
if (infoStream != null) {
message("handleMergeException: merge=" + merge.segString(directory) + " exc=" + t);
}
// Set the exception on the merge, so if
// optimize() is waiting on us it sees ... | final private void handleMergeException(Throwable t, MergePolicy.OneMerge merge) throws IOException {
if (infoStream != null) {
message("handleMergeException: merge=" + merge.segString(directory) + " exc=" + t);
}
// Set the exception on the merge, so if
// optimize() is waiting on us it sees ... |
public Map<Range, List<String>> getRangeToRpcaddressMap(String keyspace)
{
// some people just want to get a visual representation of things. Allow null and set it to the first
// non-system table.
if (keyspace == null)
keyspace = DatabaseDescriptor.getNonSystemTables().get(0... | public Map<Range, List<String>> getRangeToRpcaddressMap(String keyspace)
{
// some people just want to get a visual representation of things. Allow null and set it to the first
// non-system table.
if (keyspace == null)
keyspace = DatabaseDescriptor.getNonSystemTables().get(0... |
public final void weave(WovenClass wovenClass) {
Bundle b = wovenClass.getBundleWiring().getBundle();
if(b.getBundleId() == 0 ||
b.getSymbolicName().startsWith("org.apache.aries.proxy") ||
b.getSymbolicName().startsWith("org.apache.aries.util")) {
return;
}
if(wov... | public final void weave(WovenClass wovenClass) {
Bundle b = wovenClass.getBundleWiring().getBundle();
if(b.getBundleId() == 0 ||
b.getSymbolicName().startsWith("org.apache.aries.proxy") ||
b.getSymbolicName().startsWith("org.apache.aries.util")) {
return;
}
if(wov... |
public Writer(Directory dir, String id, Counter bytesUsed, IOContext context)
throws IOException {
super(dir, id, CODEC_NAME, VERSION_CURRENT, bytesUsed, context);
size = 0;
}
| public Writer(Directory dir, String id, Counter bytesUsed, IOContext context)
throws IOException {
super(dir, id, CODEC_NAME, VERSION_CURRENT, bytesUsed, context, Type.BYTES_VAR_DEREF);
size = 0;
}
|
public Writer(Directory dir, String id, Comparator<BytesRef> comp,
Counter bytesUsed, IOContext context, boolean fasterButMoreRam) throws IOException {
super(dir, id, CODEC_NAME, VERSION_CURRENT, bytesUsed, context, fasterButMoreRam);
this.comp = comp;
}
| public Writer(Directory dir, String id, Comparator<BytesRef> comp,
Counter bytesUsed, IOContext context, boolean fasterButMoreRam) throws IOException {
super(dir, id, CODEC_NAME, VERSION_CURRENT, bytesUsed, context, fasterButMoreRam, Type.BYTES_FIXED_SORTED);
this.comp = comp;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.