buggy_function stringlengths 1 391k | fixed_function stringlengths 0 392k |
|---|---|
public void setNextReader(AtomicReaderContext readerContext) throws IOException {
if (subDocUpto != 0) {
processGroup();
}
subDocUpto = 0;
docBase = readerContext.docBase;
//System.out.println("setNextReader base=" + docBase + " r=" + readerContext.reader);
lastDocPerGroupBits = lastDocP... | public void setNextReader(AtomicReaderContext readerContext) throws IOException {
if (subDocUpto != 0) {
processGroup();
}
subDocUpto = 0;
docBase = readerContext.docBase;
//System.out.println("setNextReader base=" + docBase + " r=" + readerContext.reader);
lastDocPerGroupBits = lastDocP... |
public void testFilterWorks() throws Exception {
Directory dir = newDirectory();
RandomIndexWriter writer = new RandomIndexWriter(random, dir, newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random)).setMergePolicy(newLogMergePolicy()));
for (int i = 0; i < 500; i++) {
Document document ... | public void testFilterWorks() throws Exception {
Directory dir = newDirectory();
RandomIndexWriter writer = new RandomIndexWriter(random, dir, newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random)).setMergePolicy(newLogMergePolicy()));
for (int i = 0; i < 500; i++) {
Document document ... |
public void testIntersectRandom() throws IOException {
final Directory dir = newDirectory();
final RandomIndexWriter w = new RandomIndexWriter(random, dir);
final int numTerms = atLeast(1000);
final Set<String> terms = new HashSet<String>();
final Collection<String> pendingTerms = new Array... | public void testIntersectRandom() throws IOException {
final Directory dir = newDirectory();
final RandomIndexWriter w = new RandomIndexWriter(random, dir);
final int numTerms = atLeast(300);
final Set<String> terms = new HashSet<String>();
final Collection<String> pendingTerms = new ArrayL... |
protected void fillShortValues( ShortValues vals, IndexReader reader, String field ) throws IOException
{
if( parser == null ) {
parser = FieldCache.DEFAULT_SHORT_PARSER;
}
setParserAndResetCounts(vals, parser);
Terms terms = MultiFields.getTerms(reader, field);
int maxDoc = reader.maxDoc... | protected void fillShortValues( ShortValues vals, IndexReader reader, String field ) throws IOException
{
if( parser == null ) {
parser = FieldCache.DEFAULT_SHORT_PARSER;
}
setParserAndResetCounts(vals, parser);
Terms terms = MultiFields.getTerms(reader, field);
int maxDoc = reader.maxDoc... |
public void testLatLongFilterOnDeletedDocs() throws Exception {
writer.deleteDocuments(new Term("name", "Potomac"));
IndexReader r = IndexReader.open(writer, true);
LatLongDistanceFilter f = new LatLongDistanceFilter(new QueryWrapperFilter(new MatchAllDocsQuery()),
... | public void testLatLongFilterOnDeletedDocs() throws Exception {
writer.deleteDocuments(new Term("name", "Potomac"));
IndexReader r = IndexReader.open(writer, true);
LatLongDistanceFilter f = new LatLongDistanceFilter(new QueryWrapperFilter(new MatchAllDocsQuery()),
... |
ConfigurationException ex = new ConfigurationException("Invalid comparator " + compareWith + " : must define a public static instance field.");
ex.initCause(e);
throw ex;
}
}
/**
* @return The Class for the given name.
* @param classname Fully qualified cla... | ConfigurationException ex = new ConfigurationException("Invalid comparator " + compareWith + " : must define a public static instance field.");
ex.initCause(e);
throw ex;
}
}
/**
* @return The Class for the given name.
* @param classname Fully qualified cla... |
String LANG_OPERATION_NOT_ALLOWED_ON_SESSION_SCHEMA_TABLES = "XCL51.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... | String LANG_OPERATION_NOT_ALLOWED_ON_SESSION_SCHEMA_TABLES = "XCL51.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... |
public void doTest() throws Exception {
del("*:*");
index(id,1, i1, 100,t1,"now is the time for all good men"
,"foo_f", 1.414f, "foo_b", "true", "foo_d", 1.414d);
index(id,2, i1, 50 ,t1,"to come to the aid of their country.");
index(id,3, i1, 2 ,t1,"how now brown cow");
index(id,4, i1,... | public void doTest() throws Exception {
del("*:*");
index(id,1, i1, 100,t1,"now is the time for all good men"
,"foo_f", 1.414f, "foo_b", "true", "foo_d", 1.414d);
index(id,2, i1, 50 ,t1,"to come to the aid of their country.");
index(id,3, i1, 2 ,t1,"how now brown cow");
index(id,4, i1,... |
private void addGroupField(Document doc, String groupField, String value, boolean canUseIDV) {
doc.add(new Field(groupField, value, TextField.TYPE_STORED));
if (canUseIDV) {
doc.add(new DocValuesField(groupField, new BytesRef(value), Type.BYTES_VAR_SORTED));
}
}
| private void addGroupField(Document doc, String groupField, String value, boolean canUseIDV) {
doc.add(new Field(groupField, value, TextField.TYPE_STORED));
if (canUseIDV) {
doc.add(new SortedBytesDocValuesField(groupField, new BytesRef(value)));
}
}
|
private void addGroupField(Document doc, String groupField, String value, boolean canUseIDV) {
doc.add(new Field(groupField, value, TextField.TYPE_STORED));
if (canUseIDV) {
doc.add(new DocValuesField(groupField, new BytesRef(value), DocValues.Type.BYTES_VAR_SORTED));
}
}
| private void addGroupField(Document doc, String groupField, String value, boolean canUseIDV) {
doc.add(new Field(groupField, value, TextField.TYPE_STORED));
if (canUseIDV) {
doc.add(new SortedBytesDocValuesField(groupField, new BytesRef(value)));
}
}
|
public static final Verb[] VERBS = Verb.values();
public static final EnumMap<StorageService.Verb, Stage> verbStages = new EnumMap<StorageService.Verb, Stage>(StorageService.Verb.class)
{{
put(Verb.MUTATION, Stage.MUTATION);
put(Verb.BINARY, Stage.MUTATION);
put(Verb.READ_REPAIR, St... | public static final Verb[] VERBS = Verb.values();
public static final EnumMap<StorageService.Verb, Stage> verbStages = new EnumMap<StorageService.Verb, Stage>(StorageService.Verb.class)
{{
put(Verb.MUTATION, Stage.MUTATION);
put(Verb.BINARY, Stage.MUTATION);
put(Verb.READ_REPAIR, St... |
protected abstract boolean isProxyClass(Class<?> clazz);
protected synchronized ClassLoader getClassLoader(final Bundle clientBundle, Collection<Class<?>> classes)
{
if (clientBundle.getState() == Bundle.UNINSTALLED) {
throw new IllegalStateException(NLS.MESSAGES.getMessage("bundle.uninstalled", clien... | protected abstract boolean isProxyClass(Class<?> clazz);
protected synchronized ClassLoader getClassLoader(final Bundle clientBundle, Collection<Class<?>> classes)
{
if (clientBundle != null && clientBundle.getState() == Bundle.UNINSTALLED) {
throw new IllegalStateException(NLS.MESSAGES.getMessage("bu... |
public static Path[] listOutputFiles(FileSystem fs, Path outpath) throws IOException {
Collection<Path> outpaths = Lists.newArrayList();
for (FileStatus s : fs.listStatus(outpath, PathFilters.logsCRCFilter())) {
if (!s.isDir()) {
outpaths.add(s.getPath());
}
}
return outpaths.toArr... | public static Path[] listOutputFiles(FileSystem fs, Path outpath) throws IOException {
Collection<Path> outpaths = Lists.newArrayList();
for (FileStatus s : fs.listStatus(outpath, PathFilters.logsCRCFilter())) {
if (!s.isDir() && !s.getPath().getName().startsWith("_")) {
outpaths.add(s.getPath()... |
public String getResolvedEntityAttribute(String name) {
checkLimited();
return super.getResolvedEntityAttribute(name);
}
| public String getResolvedEntityAttribute(String name) {
checkLimited();
return entity == null ? null : getVariableResolver().replaceTokens(entity.allAttributes.get(name));
}
|
public long getTaskCount(){
return (executorService_.getTaskCount() - executorService_.getCompletedTaskCount());
}
/* Finished implementing the IStage interface methods */
}
| public long getPendingTasks(){
return (executorService_.getTaskCount() - executorService_.getCompletedTaskCount());
}
/* Finished implementing the IStage interface methods */
}
|
public long getTaskCount();
} | public long getPendingTasks();
} |
public long getTaskCount(){
return (executorService_.getTaskCount() - executorService_.getCompletedTaskCount());
}
} | public long getPendingTasks(){
return (executorService_.getTaskCount() - executorService_.getCompletedTaskCount());
}
} |
public boolean write(Message message, EndPoint to) throws IOException
{
boolean bVal = true;
ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(bos);
Message.serializer().serialize(message, dos);
... | public boolean write(Message message, EndPoint to) throws IOException
{
boolean bVal = true;
ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(bos);
Message.serializer().serialize(message, dos);
... |
public void runMayThrow() throws Exception
{
if (DatabaseDescriptor.getCommitLogSync() == DatabaseDescriptor.CommitLogSync.batch)
{
while (true)
{
processWithSyncBatch();
compl... | public void runMayThrow() throws Exception
{
if (DatabaseDescriptor.getCommitLogSync() == DatabaseDescriptor.CommitLogSync.batch)
{
while (true)
{
processWithSyncBatch();
compl... |
private void commonTestingForTerritoryBasedDB(Statement s) throws SQLException{
PreparedStatement ps;
ResultSet rs;
Connection conn = s.getConnection();
s.executeUpdate("set schema APP");
//Following sql will fail because the compilation schema is user schema
//and hence the character constant "CUS... | private void commonTestingForTerritoryBasedDB(Statement s) throws SQLException{
PreparedStatement ps;
ResultSet rs;
Connection conn = s.getConnection();
s.executeUpdate("set schema APP");
//Following sql will fail because the compilation schema is user schema
//and hence the character constant "CUS... |
public String getBaseUrlForNodeName(final String nodeName) {
final int _offset = nodeName.indexOf("_");
if (_offset < 0) {
throw new IllegalArgumentException("nodeName does not contain expected '_' seperator: " + nodeName);
}
final String hostAndPort = nodeName.substring(0,_offset);
try {
... | public String getBaseUrlForNodeName(final String nodeName) {
final int _offset = nodeName.indexOf("_");
if (_offset < 0) {
throw new IllegalArgumentException("nodeName does not contain expected '_' seperator: " + nodeName);
}
final String hostAndPort = nodeName.substring(0,_offset);
try {
... |
public Future<?> truncate() throws IOException, ExecutionException, InterruptedException
{
// We have two goals here:
// - truncate should delete everything written before truncate was invoked
// - but not delete anything that isn't part of the snapshot we create.
// We accomplis... | public Future<?> truncate() throws IOException, ExecutionException, InterruptedException
{
// We have two goals here:
// - truncate should delete everything written before truncate was invoked
// - but not delete anything that isn't part of the snapshot we create.
// We accomplis... |
public void applyModels() throws IOException
{
ColumnFamilyStore cfs = Table.open(tableName, schema).getColumnFamilyStore(cfName);
// reinitialize the table.
KSMetaData existing = schema.getTableDefinition(tableName);
CFMetaData cfm = existing.cfMetaData().get(cfName);
K... | public void applyModels() throws IOException
{
ColumnFamilyStore cfs = Table.open(tableName, schema).getColumnFamilyStore(cfName);
// reinitialize the table.
KSMetaData existing = schema.getTableDefinition(tableName);
CFMetaData cfm = existing.cfMetaData().get(cfName);
K... |
public void applyModels() throws IOException
{
String snapshotName = Table.getTimestampedSnapshotName(null);
CompactionManager.instance.getCompactionLock().lock();
try
{
KSMetaData ksm = schema.getTableDefinition(name);
// remove all cfs from the table in... | public void applyModels() throws IOException
{
String snapshotName = Table.getTimestampedSnapshotName(name);
CompactionManager.instance.getCompactionLock().lock();
try
{
KSMetaData ksm = schema.getTableDefinition(name);
// remove all cfs from the table in... |
public void testExceptionsDuringCommit() throws Throwable {
FailOnlyInCommit[] failures = new FailOnlyInCommit[] {
// LUCENE-1214
new FailOnlyInCommit(false, FailOnlyInCommit.PREPARE_STAGE), // fail during global field map is written
new FailOnlyInCommit(true, FailOnlyInCommit.PREPARE_STAG... | public void testExceptionsDuringCommit() throws Throwable {
FailOnlyInCommit[] failures = new FailOnlyInCommit[] {
// LUCENE-1214
new FailOnlyInCommit(false, FailOnlyInCommit.PREPARE_STAGE), // fail during global field map is written
new FailOnlyInCommit(true, FailOnlyInCommit.PREPARE_STAG... |
public static void main(String[] args) throws Exception {
DefaultOptionBuilder obuilder = new DefaultOptionBuilder();
ArgumentBuilder abuilder = new ArgumentBuilder();
GroupBuilder gbuilder = new GroupBuilder();
Option parentOpt =
obuilder.withLongName("input").withRequired(true).withArgu... | public static void main(String[] args) throws Exception {
DefaultOptionBuilder obuilder = new DefaultOptionBuilder();
ArgumentBuilder abuilder = new ArgumentBuilder();
GroupBuilder gbuilder = new GroupBuilder();
Option parentOpt =
obuilder.withLongName("input").withRequired(true).withArgu... |
protected Lucene45DocValuesProducer(SegmentReadState state, String dataCodec, String dataExtension, String metaCodec, String metaExtension) throws IOException {
String metaName = IndexFileNames.segmentFileName(state.segmentInfo.name, state.segmentSuffix, metaExtension);
// read in the entries from the metadat... | protected Lucene45DocValuesProducer(SegmentReadState state, String dataCodec, String dataExtension, String metaCodec, String metaExtension) throws IOException {
String metaName = IndexFileNames.segmentFileName(state.segmentInfo.name, state.segmentSuffix, metaExtension);
// read in the entries from the metadat... |
public void testLazyLoadThreadSafety() throws Exception{
dir1 = newDirectory();
// test w/ field sizes bigger than the buffer of an index input
buildDir(dir1, 15, 5, 2000);
// do many small tests so the thread locals go away inbetween
int num = 100 * RANDOM_MULTIPLIER;
for (int i = 0; i < num... | public void testLazyLoadThreadSafety() throws Exception{
dir1 = newDirectory();
// test w/ field sizes bigger than the buffer of an index input
buildDir(dir1, 15, 5, 2000);
// do many small tests so the thread locals go away inbetween
int num = 100 * RANDOM_MULTIPLIER;
for (int i = 0; i < num... |
protected SolrServer createNewSolrServer()
{
return new EmbeddedSolrServer( h.getCore() );
}
| protected SolrServer createNewSolrServer()
{
return new EmbeddedSolrServer( h.getCoreContainer(), "" );
}
|
public void testSpanNearQuery() throws Exception {
SpanNearQuery q = makeQuery();
CheckHits.checkHits(q, FIELD, searcher, new int[] {0,1});
}
| public void testSpanNearQuery() throws Exception {
SpanNearQuery q = makeQuery();
CheckHits.checkHits(random, q, FIELD, searcher, new int[] {0,1});
}
|
private void checkHits(Query query, int[] results) throws IOException {
CheckHits.checkHits(query, "field", searcher, results);
}
| private void checkHits(Query query, int[] results) throws IOException {
CheckHits.checkHits(random, query, "field", searcher, results);
}
|
private void checkHits(Query query, int[] results) throws IOException {
CheckHits.checkHits(query, field, searcher, results);
}
| private void checkHits(Query query, int[] results) throws IOException {
CheckHits.checkHits(random, query, field, searcher, results);
}
|
protected void check(SpanQuery q, int[] docs) throws Exception {
CheckHits.checkHitCollector(q, null, searcher, docs);
}
| protected void check(SpanQuery q, int[] docs) throws Exception {
CheckHits.checkHitCollector(random, q, null, searcher, docs);
}
|
protected static void assertHits(Searcher s, Query query,
final String description, final String[] expectedIds,
final float[] expectedScores) throws IOException {
QueryUtils.check(query, s);
final float tolerance = 1e-5f;
// Hits hits = searcher.search(query);
// hits normalizes ... | protected static void assertHits(Searcher s, Query query,
final String description, final String[] expectedIds,
final float[] expectedScores) throws IOException {
QueryUtils.check(random, query, s);
final float tolerance = 1e-5f;
// Hits hits = searcher.search(query);
// hits nor... |
public void setUp() throws Exception {
super.setUp();
PayloadHelper helper = new PayloadHelper();
searcher = helper.setUp(similarity, 1000);
indexReader = searcher.getIndexReader();
}
| public void setUp() throws Exception {
super.setUp();
PayloadHelper helper = new PayloadHelper();
searcher = helper.setUp(random, similarity, 1000);
indexReader = searcher.getIndexReader();
}
|
public void testNoPayload() throws Exception {
PayloadTermQuery q1 = new PayloadTermQuery(new Term(PayloadHelper.NO_PAYLOAD_FIELD, "zero"),
new MaxPayloadFunction());
PayloadTermQuery q2 = new PayloadTermQuery(new Term(PayloadHelper.NO_PAYLOAD_FIELD, "foo"),
new MaxPayloadFunction());
... | public void testNoPayload() throws Exception {
PayloadTermQuery q1 = new PayloadTermQuery(new Term(PayloadHelper.NO_PAYLOAD_FIELD, "zero"),
new MaxPayloadFunction());
PayloadTermQuery q2 = new PayloadTermQuery(new Term(PayloadHelper.NO_PAYLOAD_FIELD, "foo"),
new MaxPayloadFunction());
... |
public void qtest(Query q, int[] expDocNrs) throws Exception {
CheckHits.checkHitCollector(q, FIELD, searcher, expDocNrs);
}
| public void qtest(Query q, int[] expDocNrs) throws Exception {
CheckHits.checkHitCollector(random, q, FIELD, searcher, expDocNrs);
}
|
private void doTestRank(String field, boolean inOrder) throws CorruptIndexException, Exception {
IndexSearcher s = new IndexSearcher(dir, true);
ValueSource vs;
if (inOrder) {
vs = new MultiValueSource(new OrdFieldSource(field));
} else {
vs = new MultiValueSource(new ReverseOrdFieldSource... | private void doTestRank(String field, boolean inOrder) throws CorruptIndexException, Exception {
IndexSearcher s = new IndexSearcher(dir, true);
ValueSource vs;
if (inOrder) {
vs = new MultiValueSource(new OrdFieldSource(field));
} else {
vs = new MultiValueSource(new ReverseOrdFieldSource... |
private void doTestRank (String field, FieldScoreQuery.Type tp) throws Exception {
IndexSearcher s = new IndexSearcher(dir, true);
Query q = new FieldScoreQuery(field,tp);
log("test: "+q);
QueryUtils.check(q,s);
ScoreDoc[] h = s.search(q, null, 1000).scoreDocs;
assertEquals("All docs should be... | private void doTestRank (String field, FieldScoreQuery.Type tp) throws Exception {
IndexSearcher s = new IndexSearcher(dir, true);
Query q = new FieldScoreQuery(field,tp);
log("test: "+q);
QueryUtils.check(random, q,s);
ScoreDoc[] h = s.search(q, null, 1000).scoreDocs;
assertEquals("All docs s... |
public void testTermVectorCorruption() throws IOException {
Directory dir = newDirectory();
for(int iter=0;iter<2;iter++) {
IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(
TEST_VERSION_CURRENT, new MockAnalyzer())
.setMaxBufferedDocs(2).setRAMBufferSizeMB(
... | public void testTermVectorCorruption() throws IOException {
Directory dir = newDirectory();
for(int iter=0;iter<2;iter++) {
IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(
TEST_VERSION_CURRENT, new MockAnalyzer())
.setMaxBufferedDocs(2).setRAMBufferSizeMB(
... |
public void testAtomicUpdates() throws Exception {
MockIndexWriter.RANDOM = random;
Directory directory;
// First in a RAM directory:
directory = new MockDirectoryWrapper(new RAMDirectory());
runTest(directory);
directory.close();
// Second in an FSDirectory:
File dirPath = _TestUtil... | public void testAtomicUpdates() throws Exception {
MockIndexWriter.RANDOM = random;
Directory directory;
// First in a RAM directory:
directory = new MockDirectoryWrapper(random, new RAMDirectory());
runTest(directory);
directory.close();
// Second in an FSDirectory:
File dirPath = _... |
public CountingRAMDirectory(Directory delegate) {
super(delegate);
}
| public CountingRAMDirectory(Directory delegate) {
super(random, delegate);
}
|
public static void main(String args[]) {
TestRunner.run(new TestSuite(Test02Boolean.class));
}
final String fieldName = "bi";
boolean verbose = false;
int maxBasicQueries = 16;
String[] docs1 = {
"word1 word2 word3",
"word4 word5",
"ord1 ord2 ord3",
"orda1 orda2 orda3 word2 worda3",
... | public static void main(String args[]) {
TestRunner.run(new TestSuite(Test02Boolean.class));
}
final String fieldName = "bi";
boolean verbose = false;
int maxBasicQueries = 16;
String[] docs1 = {
"word1 word2 word3",
"word4 word5",
"ord1 ord2 ord3",
"orda1 orda2 orda3 word2 worda3",
... |
public Object run()
{
Process result = null;
try {
result = Runtime.getRuntime().exec( command );
} catch (Exception ex) {
ex.printStackTrace();
}
... | public Object run()
{
Process result = null;
try {
result = Runtime.getRuntime().exec( command );
} catch (Exception ex) {
ex.printStackTrace();
}
... |
public void test_notBooted() throws Exception
{
if ( !getTestConfiguration().loadingFromJars() ) { return ; }
StringBuffer buffer = new StringBuffer();
String classpath = getSystemProperty( "java.class.path" );
buffer.append( getJavaExecutableName() + " -cla... | public void test_notBooted() throws Exception
{
if ( !getTestConfiguration().loadingFromJars() ) { return ; }
StringBuffer buffer = new StringBuffer();
String classpath = getSystemProperty( "java.class.path" );
buffer.append( getJavaExecutableName() + " -cla... |
private static String randomKey(Random r) {
StringBuffer buffer = new StringBuffer();
for (int j = 0; j < 16; j++) {
buffer.append((char)r.nextInt());
}
return buffer.toString();
}
| private static String randomKey(Random r) {
StringBuilder buffer = new StringBuilder();
for (int j = 0; j < 16; j++) {
buffer.append((char)r.nextInt());
}
return buffer.toString();
}
|
public StringToken getDefaultToken()
{
String initialToken = DatabaseDescriptor.getInitialToken();
if (initialToken != null)
return new StringToken(initialToken);
// generate random token
String chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"... | public StringToken getDefaultToken()
{
String initialToken = DatabaseDescriptor.getInitialToken();
if (initialToken != null)
return new StringToken(initialToken);
// generate random token
String chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"... |
public String explainPlan()
{
StringBuffer sb = new StringBuffer();
String prefix =
String.format("%s Column Family: Batch SET a set of columns: \n" +
" Table Name: %s\n" +
" Column Famly: %s\n" +
" RowKey: %s\n" +
... | public String explainPlan()
{
StringBuilder sb = new StringBuilder();
String prefix =
String.format("%s Column Family: Batch SET a set of columns: \n" +
" Table Name: %s\n" +
" Column Famly: %s\n" +
" RowKey: %s\n" +
... |
public String toString()
{
StringBuffer sb = new StringBuffer("<");
for (int idx = types_.size(); idx > 0; idx--)
{
sb.append(types_.toString());
if (idx != 1)
{
sb.append(", ");
}
... | public String toString()
{
StringBuilder sb = new StringBuilder("<");
for (int idx = types_.size(); idx > 0; idx--)
{
sb.append(types_.toString());
if (idx != 1)
{
sb.append(", ");
}
... |
public String explainPlan()
{
StringBuffer sb = new StringBuffer();
String prefix =
String.format("%s Column Family: Batch SET a set of Super Columns: \n" +
" Table Name: %s\n" +
" Column Famly: %s\n" +
" RowKey: %s\n",... | public String explainPlan()
{
StringBuilder sb = new StringBuilder();
String prefix =
String.format("%s Column Family: Batch SET a set of Super Columns: \n" +
" Table Name: %s\n" +
" Column Famly: %s\n" +
" RowKey: %s\n... |
private void setNextFileName()
{
logFile_ = DatabaseDescriptor.getLogFileLocation() + System.getProperty("file.separator") +
"CommitLog-" + System.currentTimeMillis() + ".log";
}
| private void setNextFileName()
{
logFile_ = DatabaseDescriptor.getLogFileLocation() + File.separator +
"CommitLog-" + System.currentTimeMillis() + ".log";
}
|
private PriorityQueue<FileStruct> initializePriorityQueue(List<String> files, List<Range> ranges, int minBufferSize)
{
PriorityQueue<FileStruct> pq = new PriorityQueue<FileStruct>();
if (files.size() > 1 || (ranges != null && files.size() > 0))
{
int bufferSize = Math.min((Co... | private PriorityQueue<FileStruct> initializePriorityQueue(List<String> files, List<Range> ranges, int minBufferSize)
{
PriorityQueue<FileStruct> pq = new PriorityQueue<FileStruct>();
if (files.size() > 1 || (ranges != null && files.size() > 0))
{
int bufferSize = Math.min((Co... |
public static void main(String[] args) throws Throwable
{
if ( args.length != 2 )
{
System.out.println("Usage : java com.facebook.infrastructure.tools.ThreadListBuilder <directory containing files to be processed> <directory to dump the bloom filter in.>");
System.exit(1)... | public static void main(String[] args) throws Throwable
{
if ( args.length != 2 )
{
System.out.println("Usage : java com.facebook.infrastructure.tools.ThreadListBuilder <directory containing files to be processed> <directory to dump the bloom filter in.>");
System.exit(1)... |
private static String initialToken_ = null;
static
{
try
{
configFileName_ = System.getProperty("storage-config") + System.getProperty("file.separator") + "storage-conf.xml";
if (logger_.isDebugEnabled())
logger_.debug("Loading settings from " + configF... | private static String initialToken_ = null;
static
{
try
{
configFileName_ = System.getProperty("storage-config") + File.separator + "storage-conf.xml";
if (logger_.isDebugEnabled())
logger_.debug("Loading settings from " + configFileName_);
... |
private void executeConnect(CommonTree ast) throws TException
{
int portNumber = Integer.parseInt(ast.getChild(1).getText());
Tree idList = ast.getChild(0);
StringBuffer hostName = new StringBuffer();
int idCount = idList.getChildCount();
for (int idx = 0; idx <... | private void executeConnect(CommonTree ast) throws TException
{
int portNumber = Integer.parseInt(ast.getChild(1).getText());
Tree idList = ast.getChild(0);
StringBuilder hostName = new StringBuilder();
int idCount = idList.getChildCount();
for (int idx = 0; idx... |
private void doFullDump() {
addStatusMessage("Full Dump Started");
if(dataImporter.getConfig().isMultiThreaded && !verboseDebug){
try {
LOG.info("running multithreaded full-import");
new EntityRunner(root,null).run(null,Context.FULL_DUMP,null);
} catch (Exception e) {
LOG.e... | private void doFullDump() {
addStatusMessage("Full Dump Started");
if(dataImporter.getConfig().isMultiThreaded && !verboseDebug){
try {
LOG.info("running multithreaded full-import");
new EntityRunner(root,null).run(null,Context.FULL_DUMP,null);
} catch (Exception e) {
throw... |
public StorageService()
{
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
try
{
mbs.registerMBean(this, new ObjectName("org.apache.cassandra.service:type=StorageService"));
}
catch (Exception e)
{
throw new RuntimeException(e)... | public StorageService()
{
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
try
{
mbs.registerMBean(this, new ObjectName("org.apache.cassandra.service:type=StorageService"));
}
catch (Exception e)
{
throw new RuntimeException(e)... |
public static void serializeInternal(IIterableColumns columns, DataOutput dos) throws IOException
{
int columnCount = columns.getEstimatedColumnCount();
BloomFilter bf = BloomFilter.getFilter(columnCount, 4);
if (columnCount == 0)
{
writeEmptyHeader(dos, bf);
... | public static void serializeInternal(IIterableColumns columns, DataOutput dos) throws IOException
{
int columnCount = columns.getEstimatedColumnCount();
BloomFilter bf = BloomFilter.getFilter(columnCount, 4);
if (columnCount == 0)
{
writeEmptyHeader(dos, bf);
... |
private int formatM1SkipInterval;
SegmentTermEnum(IndexInput i, FieldInfos fis, boolean isi)
throws CorruptIndexException, IOException {
input = i;
fieldInfos = fis;
isIndex = isi;
maxSkipLevels = 1; // use single-level skip lists for formats > -3
int firstInt = input.readInt();... | private int formatM1SkipInterval;
SegmentTermEnum(IndexInput i, FieldInfos fis, boolean isi)
throws CorruptIndexException, IOException {
input = i;
fieldInfos = fis;
isIndex = isi;
maxSkipLevels = 1; // use single-level skip lists for formats > -3
int firstInt = input.readInt();... |
public CharSequence system_update_column_family(CfDef cf_def) throws AvroRemoteException, InvalidRequestException
{
checkKeyspaceAndLoginAuthorized(Permission.WRITE);
if (cf_def.keyspace == null || cf_def.name == null)
throw newInvalidRequestException("Keyspace and CF name m... | public CharSequence system_update_column_family(CfDef cf_def) throws AvroRemoteException, InvalidRequestException
{
checkKeyspaceAndLoginAuthorized(Permission.WRITE);
if (cf_def.keyspace == null || cf_def.name == null)
throw newInvalidRequestException("Keyspace and CF name m... |
public void testSimple() throws Exception {
String[] fields = {"b", "t"};
MultiFieldQueryParser mfqp = new MultiFieldQueryParser(fields, new StandardAnalyzer());
Query q = mfqp.parse("one");
assertEquals("b:one t:one", q.toString());
q = mfqp.parse("one two");
assertEquals("(b:one t:... | public void testSimple() throws Exception {
String[] fields = {"b", "t"};
MultiFieldQueryParser mfqp = new MultiFieldQueryParser(fields, new StandardAnalyzer());
Query q = mfqp.parse("one");
assertEquals("b:one t:one", q.toString());
q = mfqp.parse("one two");
assertEquals("(b:one t:... |
public static void main(String args[]) {
NetworkServerControlImpl server = null;
//
// The following variable lets us preserve the error printing behavior
// seen before we started installing a security manager. Errors can be
// raised as we figure out whether we need to ins... | public static void main(String args[]) {
NetworkServerControlImpl server = null;
//
// The following variable lets us preserve the error printing behavior
// seen before we started installing a security manager. Errors can be
// raised as we figure out whether we need to ins... |
public SearchResults(Hits hits, int from, int to) throws IOException
{
hitsDocuments = new Document[hits.length()];
totalNumberOfResults = hits.length();
if (to > totalNumberOfResults)
{
to = totalNumberOfResults;
}
for (int i = from; i < to; i++)
... | public SearchResults(Hits hits, int from, int to) throws IOException
{
hitsDocuments = new Document[hits.length()];
totalNumberOfResults = hits.length();
if (to > totalNumberOfResults)
{
to = totalNumberOfResults;
}
for (int i = from; i < to; i++)
... |
private void getCursor() throws StandardException {
// need to look again if cursor was closed
if (cursor != null) {
if (cursor.isClosed())
{
cursor = null;
target = null;
}
}
if (cursor == null) {
LanguageConnectionContext lcc = getLanguageConnectionContext();
CursorActivation curso... | private void getCursor() throws StandardException {
// need to look again if cursor was closed
if (cursor != null) {
if (cursor.isClosed())
{
cursor = null;
target = null;
}
}
if (cursor == null) {
LanguageConnectionContext lcc = getLanguageConnectionContext();
CursorActivation curso... |
public IndexFileDeleter(Directory directory, IndexDeletionPolicy policy, SegmentInfos segmentInfos,
InfoStream infoStream, IndexWriter writer) throws CorruptIndexException, IOException {
this.infoStream = infoStream;
this.writer = writer;
final String currentSegmentsFile = segme... | public IndexFileDeleter(Directory directory, IndexDeletionPolicy policy, SegmentInfos segmentInfos,
InfoStream infoStream, IndexWriter writer) throws CorruptIndexException, IOException {
this.infoStream = infoStream;
this.writer = writer;
final String currentSegmentsFile = segme... |
public void testLongPostings() throws Exception {
assumeFalse("Too slow with SimpleText codec", CodecProvider.getDefault().getFieldCodec("field").equals("SimpleText"));
// Don't use _TestUtil.getTempDir so that we own the
// randomness (ie same seed will point to same dir):
Directory dir = newFSDirec... | public void testLongPostings() throws Exception {
assumeFalse("Too slow with SimpleText codec", CodecProvider.getDefault().getFieldCodec("field").equals("SimpleText"));
// Don't use _TestUtil.getTempDir so that we own the
// randomness (ie same seed will point to same dir):
Directory dir = newFSDirec... |
private StreamContextManager.StreamStatus streamStatus_;
ContentStreamState(TcpReader stream)
{
super(stream);
SocketChannel socketChannel = stream.getStream();
InetSocketAddress remoteAddress = (InetSocketAddress)socketChannel.socket().getRemoteSocketAddress();
String ... | private StreamContextManager.StreamStatus streamStatus_;
ContentStreamState(TcpReader stream)
{
super(stream);
SocketChannel socketChannel = stream.getStream();
InetSocketAddress remoteAddress = (InetSocketAddress)socketChannel.socket().getRemoteSocketAddress();
String ... |
private Status.TermIndexStatus testTermIndex(SegmentReader reader) {
final Status.TermIndexStatus status = new Status.TermIndexStatus();
final int maxDoc = reader.maxDoc();
final Bits delDocs = reader.getDeletedDocs();
try {
if (infoStream != null) {
infoStream.print(" test: terms,... | private Status.TermIndexStatus testTermIndex(SegmentReader reader) {
final Status.TermIndexStatus status = new Status.TermIndexStatus();
final int maxDoc = reader.maxDoc();
final Bits delDocs = reader.getDeletedDocs();
try {
if (infoStream != null) {
infoStream.print(" test: terms,... |
private void collectVectorsForAssertion() throws IOException {
Path[] partFilePaths = FileUtil.stat2Paths(fs
.globStatus(classifiedOutputPath));
FileStatus[] listStatus = fs.listStatus(partFilePaths,
PathFilters.partFilter());
for (FileStatus partFile : listStatus) {
SequenceFile.Rea... | private void collectVectorsForAssertion() throws IOException {
Path[] partFilePaths = FileUtil.stat2Paths(fs
.globStatus(classifiedOutputPath));
FileStatus[] listStatus = fs.listStatus(partFilePaths,
PathFilters.partFilter());
for (FileStatus partFile : listStatus) {
SequenceFile.Rea... |
public long ramBytesUsed() {
return RamUsageEstimator.NUM_BYTES_ARRAY_HEADER + values.length;
}
| public long ramBytesUsed() {
return RamUsageEstimator.sizeOf(values);
}
|
public Map<Token, Float> describeOwnership(List<Token> sortedTokens)
{
// allTokens will contain the count and be returned, sorted_ranges is shorthand for token<->token math.
Map<Token, Float> allTokens = new HashMap<Token, Float>();
List<Range> sortedRanges = new ArrayList<Range>();
... | public Map<Token, Float> describeOwnership(List<Token> sortedTokens)
{
// allTokens will contain the count and be returned, sorted_ranges is shorthand for token<->token math.
Map<Token, Float> allTokens = new HashMap<Token, Float>();
List<Range> sortedRanges = new ArrayList<Range>();
... |
public void multiBundleTest() throws Exception {
//bundlea provides the ns handlers, bean processors, interceptors etc for this test.
Bundle bundlea = context().getBundleByName("org.apache.aries.blueprint.testbundlea");
assertNotNull(bundlea);
bundlea.start();
... | public void multiBundleTest() throws Exception {
//bundlea provides the ns handlers, bean processors, interceptors etc for this test.
Bundle bundlea = context().getBundleByName("org.apache.aries.blueprint.testbundlea");
assertNotNull(bundlea);
bundlea.start();
... |
public Message handleMessage(Message msg, InetAddress to)
{
if (msg.getVerb().equals(StorageService.Verb.REPLICATION_FINISHED))
{
callCount++;
assertEquals(Stage.MISC, msg.getMessageType());
// simulate a response from remote server... | public Message handleMessage(Message msg, InetAddress to)
{
if (msg.getVerb().equals(StorageService.Verb.REPLICATION_FINISHED))
{
callCount++;
assertEquals(Stage.MISC, msg.getMessageType());
// simulate a response from remote server... |
public void doVerb(Message message)
{
StorageService ss = StorageService.instance;
String tokenString = StorageService.getPartitioner().getTokenFactory().toString(ss.getBootstrapToken());
Message response = message.getInternalReply(tokenString.getBytes(Charsets.UTF_8)... | public void doVerb(Message message)
{
StorageService ss = StorageService.instance;
String tokenString = StorageService.getPartitioner().getTokenFactory().toString(ss.getBootstrapToken());
Message response = message.getInternalReply(tokenString.getBytes(Charsets.UTF_8)... |
public static Message makeWriteResponseMessage(Message original, WriteResponse writeResponseMessage) throws IOException
{
ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream( bos );
WriteResponse.serializer().serialize(writeResponseMessage, d... | public static Message makeWriteResponseMessage(Message original, WriteResponse writeResponseMessage) throws IOException
{
ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream( bos );
WriteResponse.serializer().serialize(writeResponseMessage, d... |
public void doVerb(Message message)
{
logger.debug("Received schema check request.");
Message response = message.getInternalReply(DatabaseDescriptor.getDefsVersion().toString().getBytes());
MessagingService.instance().sendOneWay(response, message.getFrom());
}
| public void doVerb(Message message)
{
logger.debug("Received schema check request.");
Message response = message.getInternalReply(DatabaseDescriptor.getDefsVersion().toString().getBytes(), message.getVersion());
MessagingService.instance().sendOneWay(response, message.getFrom());
}
|
public Message getReply(Message originalMessage) throws IOException
{
DataOutputBuffer dob = new DataOutputBuffer();
dob.writeInt(rows.size());
for (Row row : rows)
{
Row.serializer().serialize(row, dob);
}
byte[] data = Arrays.copyOf(dob.getData(), do... | public Message getReply(Message originalMessage) throws IOException
{
DataOutputBuffer dob = new DataOutputBuffer();
dob.writeInt(rows.size());
for (Row row : rows)
{
Row.serializer().serialize(row, dob);
}
byte[] data = Arrays.copyOf(dob.getData(), do... |
public static Message makeTruncateResponseMessage(Message original, TruncateResponse truncateResponseMessage)
throws IOException
{
ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(bos);
TruncateResponse.serializer().serialize(t... | public static Message makeTruncateResponseMessage(Message original, TruncateResponse truncateResponseMessage)
throws IOException
{
ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(bos);
TruncateResponse.serializer().serialize(t... |
public void doVerb(Message message)
{
byte[] body = message.getMessageBody();
/* Obtain a Read Context from TLS */
ReadContext readCtx = tls_.get();
if ( readCtx == null )
{
readCtx = new ReadContext();
tls_.set(readCtx);
}
readCtx.... | public void doVerb(Message message)
{
byte[] body = message.getMessageBody();
/* Obtain a Read Context from TLS */
ReadContext readCtx = tls_.get();
if ( readCtx == null )
{
readCtx = new ReadContext();
tls_.set(readCtx);
}
readCtx.... |
public void doVerb(Message msg)
{
StorageService.instance.confirmReplication(msg.getFrom());
Message response = msg.getInternalReply(ArrayUtils.EMPTY_BYTE_ARRAY);
if (logger.isDebugEnabled())
logger.debug("Replying to " + msg.getMessageId() + "@" + msg.getFrom());
Mes... | public void doVerb(Message msg)
{
StorageService.instance.confirmReplication(msg.getFrom());
Message response = msg.getInternalReply(ArrayUtils.EMPTY_BYTE_ARRAY, msg.getVersion());
if (logger.isDebugEnabled())
logger.debug("Replying to " + msg.getMessageId() + "@" + msg.getFr... |
public void doVerb(Message message)
{
Message reply = message.getInternalReply(new byte[] {(byte)(isMoveable_.get() ? 1 : 0)});
MessagingService.instance().sendOneWay(reply, message.getFrom());
if ( isMoveable_.get() )
{
// MoveMessage move... | public void doVerb(Message message)
{
Message reply = message.getInternalReply(new byte[] {(byte)(isMoveable_.get() ? 1 : 0)}, message.getVersion());
MessagingService.instance().sendOneWay(reply, message.getFrom());
if ( isMoveable_.get() )
{
... |
public void write(int c) {
StringBuffer sb = new StringBuffer(clob_.string_.substring(0, (int) offset_ - 1));
sb.append(c);
clob_.string_ = sb.toString();
clob_.asciiStream_ = new java.io.StringBufferInputStream(clob_.string_);
clob_.unicodeStream_ = new java.io.StringBufferI... | public void write(int c) {
StringBuffer sb = new StringBuffer(clob_.string_.substring(0, (int) offset_ - 1));
sb.append((char)c);
clob_.string_ = sb.toString();
clob_.asciiStream_ = new java.io.StringBufferInputStream(clob_.string_);
clob_.unicodeStream_ = new java.io.StringB... |
public void setUp() throws Exception {
super.setUp();
params.set(PFPGrowth.MIN_SUPPORT, "3");
params.set(PFPGrowth.MAX_HEAPSIZE, "4");
params.set(PFPGrowth.NUM_GROUPS, "2");
params.set(PFPGrowth.ENCODING, "UTF-8");
File inputDir = getTestTempDir("transactions");
File outputDir = getTestTem... | public void setUp() throws Exception {
super.setUp();
params.set(PFPGrowth.MIN_SUPPORT, "3");
params.set(PFPGrowth.MAX_HEAPSIZE, "4");
params.set(PFPGrowth.NUM_GROUPS, "2");
params.set(PFPGrowth.ENCODING, "UTF-8");
File inputDir = getTestTempDir("transactions");
File outputDir = getTestTem... |
public void setUp() throws Exception {
super.setUp();
params.set(PFPGrowth.MIN_SUPPORT, "3");
params.set(PFPGrowth.MAX_HEAPSIZE, "4");
params.set(PFPGrowth.NUM_GROUPS, "2");
params.set(PFPGrowth.ENCODING, "UTF-8");
params.set(PFPGrowth.USE_FPG2, "true");
File inputDir = getTestTempDir("tra... | public void setUp() throws Exception {
super.setUp();
params.set(PFPGrowth.MIN_SUPPORT, "3");
params.set(PFPGrowth.MAX_HEAPSIZE, "4");
params.set(PFPGrowth.NUM_GROUPS, "2");
params.set(PFPGrowth.ENCODING, "UTF-8");
params.set(PFPGrowth.USE_FPG2, "true");
File inputDir = getTestTempDir("tra... |
public void doTest() throws Exception {
boolean testFinished = false;
try {
handle.clear();
handle.put("QTime", SKIPVAL);
handle.put("timestamp", SKIPVAL);
// todo: do I have to do this here?
waitForRecoveriesToFinish(false);
doHashingTest();
doTestNumRequests();
... | public void doTest() throws Exception {
boolean testFinished = false;
try {
handle.clear();
handle.put("QTime", SKIPVAL);
handle.put("timestamp", SKIPVAL);
// todo: do I have to do this here?
waitForRecoveriesToFinish(false);
doHashingTest();
doTestNumRequests();
... |
private synchronized void loadEndPoints(TokenMetadata metadata) throws IOException
{
this.tokens = new ArrayList<Token>(tokens);
String localDC = ((DatacenterEndPointSnitch)snitch_).getLocation(InetAddress.getLocalHost());
dcMap = new HashMap<String, List<Token>>();
for (Token to... | private synchronized void loadEndPoints(TokenMetadata metadata) throws IOException
{
this.tokens = new ArrayList<Token>(metadata.sortedTokens());
String localDC = ((DatacenterEndPointSnitch)snitch_).getLocation(InetAddress.getLocalHost());
dcMap = new HashMap<String, List<Token>>();
... |
public void bindStatement() throws StandardException
{
// We just need select privilege on the expressions
getCompilerContext().pushCurrentPrivType( Authorizer.SELECT_PRIV);
FromList fromList = (FromList) getNodeFactory().getNode(
C_NodeTypes.FROM_LIST,
getNodeFactory().doJoinOrderOptimizatio... | public void bindStatement() throws StandardException
{
// We just need select privilege on the expressions
getCompilerContext().pushCurrentPrivType( Authorizer.SELECT_PRIV);
FromList fromList = (FromList) getNodeFactory().getNode(
C_NodeTypes.FROM_LIST,
getNodeFactory().doJoinOrderOptimizatio... |
private void enhanceAndCheckForAutoincrement(ResultSetNode resultSet,
boolean inOrder, int numTableColumns, int []colMap,
DataDictionary dataDictionary,
TableDescriptor targetTableDescriptor,
FromVTI targetVTI)
throws StandardException
{
/*
* Some implementation notes:
*
* colmap[... | private void enhanceAndCheckForAutoincrement(ResultSetNode resultSet,
boolean inOrder, int numTableColumns, int []colMap,
DataDictionary dataDictionary,
TableDescriptor targetTableDescriptor,
FromVTI targetVTI)
throws StandardException
{
/*
* Some implementation notes:
*
* colmap[... |
public void init() throws BundleException
{
if (_compositeBundle.getCompositeFramework().getState() != Framework.ACTIVE)
{
_compositeBundle.start(Bundle.START_ACTIVATION_POLICY);
_packageAdminTracker = new ServiceTracker(_compositeBundle.getBundleContext(),
PackageAdmin.class.getNam... | public void init() throws BundleException
{
if (_compositeBundle.getCompositeFramework().getState() != Framework.ACTIVE)
{
_compositeBundle.start(Bundle.START_ACTIVATION_POLICY);
_packageAdminTracker = new ServiceTracker(_compositeBundle.getCompositeFramework().getBundleContext(),
P... |
public double dot(Vector x) {
if (size() != x.size()) {
throw new CardinalityException();
}
double result = 0;
Iterator<Element> iter = iterateNonZero();
while (iter.hasNext()) {
Element element = iter.next();
result += element.get() * x.getQuick(element.index());
}
retu... | public double dot(Vector x) {
if (size() != x.size()) {
throw new CardinalityException(size(), x.size());
}
double result = 0;
Iterator<Element> iter = iterateNonZero();
while (iter.hasNext()) {
Element element = iter.next();
result += element.get() * x.getQuick(element.index());... |
protected SSTableWriter getWriter() throws IOException
{
return new SSTableWriter(
makeFilename(directory, metadata.ksName, metadata.cfName),
0, // We don't care about the bloom filter
metadata,
StorageService.getPartitioner(),
ReplayPosition.N... | protected SSTableWriter getWriter() throws IOException
{
return new SSTableWriter(
makeFilename(directory, metadata.ksName, metadata.cfName),
0, // We don't care about the bloom filter
metadata,
StorageService.getPartitioner(),
SSTableMetadata.... |
private void processFile(String filename)
throws IOException, DRDAProtocolException
{
String prev_filename = current_filename;
current_filename = filename;
String hostName=getHostName();
BufferedReader fr;
try
{
fr = new BufferedReader(new InputStreamReader(new FileInputStream(fi... | private void processFile(String filename)
throws IOException, DRDAProtocolException
{
String prev_filename = current_filename;
current_filename = filename;
String hostName=getHostName();
BufferedReader fr;
try
{
fr = new BufferedReader(new InputStreamReader(new FileInputStream(fi... |
//But since we still support jdk13, we can't rely on these methods being public starting jdk14.
//Because of that, we are using Date to do all the time manipulations on the Calendar object
StringBuffer generatedSystemSQLName = new StringBuffer("SQL");
synchronized (this) {
//get the current timestamp
... | //But since we still support jdk13, we can't rely on these methods being public starting jdk14.
//Because of that, we are using Date to do all the time manipulations on the Calendar object
StringBuffer generatedSystemSQLName = new StringBuffer("SQL");
synchronized (this) {
//get the current timestamp
... |
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
if( abortErrorMessage != null ) {
((HttpServletResponse)response).sendError( 500, abortErrorMessage );
return;
}
if( request instanceof HttpServletRequest) {
... | public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
if( abortErrorMessage != null ) {
((HttpServletResponse)response).sendError( 500, abortErrorMessage );
return;
}
if( request instanceof HttpServletRequest) {
... |
public static List<List<String>> topWordsForTopics(String dir,
Configuration job,
List<String> wordList,
int numWordsToPrint) throws IOException {
FileSyst... | public static List<List<String>> topWordsForTopics(String dir,
Configuration job,
List<String> wordList,
int numWordsToPrint) throws IOException {
FileSyst... |
public DefaultTermVectorsWriter(Directory directory, String segment, IOContext context) throws IOException {
this.directory = directory;
this.segment = segment;
boolean success = false;
try {
// Open files for TermVector storage
tvx = directory.createOutput(IndexFileNames.segmentFileName(s... | public DefaultTermVectorsWriter(Directory directory, String segment, IOContext context) throws IOException {
this.directory = directory;
this.segment = segment;
boolean success = false;
try {
// Open files for TermVector storage
tvx = directory.createOutput(IndexFileNames.segmentFileName(s... |
public ImportedServiceImpl (String ifaceName, Map<String, String> attributes) throws InvalidAttributeException {
_optional = false;
_iface = ifaceName;
_isMultiple = false;
_componentName = null;
_id = null;
_attributes = new HashMap<String, String>(attributes);
// The syntax for... | public ImportedServiceImpl (String ifaceName, Map<String, String> attributes) throws InvalidAttributeException {
_optional = ("optional".equals(attributes.get("availability:")));
_iface = ifaceName;
_isMultiple = false;
_componentName = null;
_id = null;
_attributes = new HashMap<String, ... |
private JCas processText(String textFieldValue) throws ResourceInitializationException,
AnalysisEngineProcessException {
log.info(new StringBuffer("Analazying text").toString());
/* get the UIMA analysis engine */
AnalysisEngine ae = aeProvider.getAE();
/* create a JCas which contain the te... | private JCas processText(String textFieldValue) throws ResourceInitializationException,
AnalysisEngineProcessException {
log.info(new StringBuffer("Analyzing text").toString());
/* get the UIMA analysis engine */
AnalysisEngine ae = aeProvider.getAE();
/* create a JCas which contain the tex... |
public Object transformRow(Map<String, Object> row, Context context) {
for (Map<String, String> fld : context.getAllEntityFields()) {
String style = context.replaceTokens(fld.get(FORMAT_STYLE));
if (style != null) {
String column = fld.get(DataImporter.COLUMN);
String srcCol = fld.get(... | public Object transformRow(Map<String, Object> row, Context context) {
for (Map<String, String> fld : context.getAllEntityFields()) {
String style = context.replaceTokens(fld.get(FORMAT_STYLE));
if (style != null) {
String column = fld.get(DataImporter.COLUMN);
String srcCol = fld.get(... |
public Object transformRow(Map<String, Object> aRow, Context context) {
for (Map<String, String> map : context.getAllEntityFields()) {
Locale locale = Locale.getDefault();
String customLocale = map.get("locale");
if(customLocale != null){
locale = new Locale(customLocale);
}
... | public Object transformRow(Map<String, Object> aRow, Context context) {
for (Map<String, String> map : context.getAllEntityFields()) {
Locale locale = Locale.ROOT;
String customLocale = map.get("locale");
if(customLocale != null){
locale = new Locale(customLocale);
}
String... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.