buggy_function stringlengths 1 391k | fixed_function stringlengths 0 392k |
|---|---|
public void testSnitch() throws InterruptedException, IOException, ConfigurationException
{
// do this because SS needs to be initialized before DES can work properly.
StorageService.instance.initClient();
int sleeptime = 150;
DynamicEndpointSnitch dsnitch = new DynamicEndpointSn... | public void testSnitch() throws InterruptedException, IOException, ConfigurationException
{
// do this because SS needs to be initialized before DES can work properly.
StorageService.instance.initClient(0);
int sleeptime = 150;
DynamicEndpointSnitch dsnitch = new DynamicEndpointS... |
final private int mergeMiddle(MergePolicy.OneMerge merge)
throws CorruptIndexException, IOException {
merge.checkAborted(directory);
final String mergedName = merge.info.name;
int mergedDocCount = 0;
SegmentInfos sourceSegments = merge.segments;
final int numSegments = sourceSegme... | final private int mergeMiddle(MergePolicy.OneMerge merge)
throws CorruptIndexException, IOException {
merge.checkAborted(directory);
final String mergedName = merge.info.name;
int mergedDocCount = 0;
SegmentInfos sourceSegments = merge.segments;
final int numSegments = sourceSegme... |
public Query getHighlightQuery() throws ParseException {
return parsedUserQuery;
}
| public Query getHighlightQuery() throws ParseException {
return parsedUserQuery == null ? altUserQuery : parsedUserQuery;
}
|
public final void close() {
fileMap = null;
}
} | public void close() {
fileMap = null;
}
} |
public void testStressIndexAndSearching() throws Exception {
// First in a RAM directory:
Directory directory = new RAMDirectory();
runStressTest(directory);
directory.close();
// Second in an FSDirectory:
String tempDir = System.getProperty("java.io.tmpdir");
File dirPath = new File(tem... | public void testStressIndexAndSearching() throws Exception {
// First in a RAM directory:
Directory directory = new MockRAMDirectory();
runStressTest(directory);
directory.close();
// Second in an FSDirectory:
String tempDir = System.getProperty("java.io.tmpdir");
File dirPath = new File... |
public void tearDown() throws Exception {
if (cores != null)
cores.shutdown();
File dataDir = new File(getSolrHome() + "/data");
String skip = System.getProperty("solr.test.leavedatadir");
if (null != skip && 0 != skip.trim().length()) {
log.info("NOTE: per solr.test.leavedatadir, dataDir ... | public void tearDown() throws Exception {
if (cores != null)
cores.shutdown();
File dataDir = new File(getSolrHome() + "/data");
String skip = System.getProperty("solr.test.leavedatadir");
if (null != skip && 0 != skip.trim().length()) {
log.info("NOTE: per solr.test.leavedatadir, dataDir ... |
public void schedule(InetAddress target, RowMutationMessage rowMutationMessage)
{
try
{
Message message = rowMutationMessage.makeRowMutationMessage(StorageService.readRepairVerbHandler_);
String key = target + ":" + message.getMessageId();
readRepairTable_.put(key, message);
... | public void schedule(InetAddress target, RowMutationMessage rowMutationMessage)
{
try
{
Message message = rowMutationMessage.makeRowMutationMessage(StorageService.readRepairVerbHandler_);
String key = target.getHostAddress() + ":" + message.getMessageId();
readRepairTable_.put(... |
public IValidator getValidator(String table, String cf, InetAddress initiator, boolean major)
{
if (!major || table.equals(Table.SYSTEM_TABLE))
return new NoopValidator();
if (StorageService.instance.getTokenMetadata().sortedTokens().size() < 1)
// gossiper isn't started... | public IValidator getValidator(String table, String cf, InetAddress initiator, boolean major)
{
if (!major || table.equals(Table.SYSTEM_TABLE) || table.equals(Table.DEFINITIONS))
return new NoopValidator();
if (StorageService.instance.getTokenMetadata().sortedTokens().size() < 1)
... |
public void test_errorcode() throws Exception
{
ResultSet rs = null;
Statement s = createStatement();
s.executeUpdate(
"create table t(i int, s smallint)");
s.executeUpdate(
"insert into t values (1,2)");
s.executeUpdate("insert i... | public void test_errorcode() throws Exception
{
ResultSet rs = null;
Statement s = createStatement();
s.executeUpdate(
"create table t(i int, s smallint)");
s.executeUpdate(
"insert into t values (1,2)");
s.executeUpdate("insert i... |
public synchronized Similarity get(String field) {
assert field != null;
Similarity sim = previousMappings.get(field);
if (sim == null) {
sim = knownSims.get(Math.abs(perFieldSeed ^ field.hashCode()) % knownSims.size());
previousMappings.put(field, sim);
}
return sim;
}
// all t... | public synchronized Similarity get(String field) {
assert field != null;
Similarity sim = previousMappings.get(field);
if (sim == null) {
sim = knownSims.get(Math.abs(perFieldSeed ^ field.hashCode()) % knownSims.size());
previousMappings.put(field, sim);
}
return sim;
}
// all t... |
public static void main(String[] args) throws IOException {
DefaultOptionBuilder obuilder = new DefaultOptionBuilder();
ArgumentBuilder abuilder = new ArgumentBuilder();
GroupBuilder gbuilder = new GroupBuilder();
Option seqOpt = obuilder.withLongName("seqFile").withRequired(false).withArgument(
... | public static void main(String[] args) throws IOException {
DefaultOptionBuilder obuilder = new DefaultOptionBuilder();
ArgumentBuilder abuilder = new ArgumentBuilder();
GroupBuilder gbuilder = new GroupBuilder();
Option seqOpt = obuilder.withLongName("seqFile").withRequired(false).withArgument(
... |
public 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 void testIndexCreate() throws IOException, ConfigurationException, InterruptedException, ExecutionException
{
Table table = Table.open("Keyspace1");
// create a row and update the birthdate value, test that the index query fetches the new version
RowMutation rm;
rm = new ... | public void testIndexCreate() throws IOException, ConfigurationException, InterruptedException, ExecutionException
{
Table table = Table.open("Keyspace1");
// create a row and update the birthdate value, test that the index query fetches the new version
RowMutation rm;
rm = new ... |
public DocIdSet getDocIdSet(AtomicReaderContext ctx, Bits acceptDocs) throws IOException {
AtomicReader reader = ctx.reader();
OpenBitSet bits = new OpenBitSet(reader.maxDoc());
Terms terms = reader.terms(fieldName);
if (terms == null)
return null;
TermsEnum termsEnum = terms.iterator(null);... | public DocIdSet getDocIdSet(AtomicReaderContext ctx, Bits acceptDocs) throws IOException {
AtomicReader reader = ctx.reader();
OpenBitSet bits = new OpenBitSet(reader.maxDoc());
Terms terms = reader.terms(fieldName);
if (terms == null)
return null;
TermsEnum termsEnum = terms.iterator(null);... |
public Collection<Node> getSubCells(Shape shapeFilter) {
//Note: Higher-performing subclasses might override to consider the shape filter to generate fewer cells.
if (shapeFilter instanceof Point) {
return Collections.singleton(getSubCell((Point) shapeFilter));
}
Collection<Node> cells = getSubC... | public Collection<Node> getSubCells(Shape shapeFilter) {
//Note: Higher-performing subclasses might override to consider the shape filter to generate fewer cells.
if (shapeFilter instanceof Point) {
return Collections.singleton(getSubCell((Point) shapeFilter));
}
Collection<Node> cells = getSubC... |
public double getFloorSegmentMB() {
return floorSegmentBytes/1024*1024.;
}
| public double getFloorSegmentMB() {
return floorSegmentBytes/(1024*1024.);
}
|
protected boolean isDropped;
/**
Committed Drop state of the container. If a post comit action
determined that the drop container operation is committed, the whole
| protected boolean isDropped;
/**
Committed Drop state of the container. If a post commit action
determined that the drop container operation is committed, the whole
|
public boolean getFacetSort() {
return this.getBool(FacetParams.FACET_SORT, false);
}
| public boolean getFacetSort() {
return this.getBool(FacetParams.FACET_SORT, true);
}
|
private String cachePath(Bundle bundle, String filePath)
{
return bundle.getSymbolicName() + "/" + bundle.getVersion() + "/" + filePath;
}
| private String cachePath(Bundle bundle, String filePath)
{
return Integer.toHexString(bundle.hashCode()) + "/" + filePath;
}
|
public column_t get_column(String tablename, String key, String columnPath) throws NotFoundException, InvalidRequestException
{
logger.debug("get_column");
String[] values = RowMutation.getColumnAndColumnFamily(columnPath);
if (values.length < 1)
{
throw new InvalidRe... | public column_t get_column(String tablename, String key, String columnPath) throws NotFoundException, InvalidRequestException
{
logger.debug("get_column");
String[] values = RowMutation.getColumnAndColumnFamily(columnPath);
if (values.length < 1)
{
throw new InvalidRe... |
public Row getSliceFrom(String key, String cf, boolean isAscending, int count) throws IOException
{
Row row = new Row(key);
String[] values = RowMutation.getColumnAndColumnFamily(cf);
| public Row getSliceFrom(String key, String cf, boolean isAscending, int count) throws IOException
{
Row row = new Row(table_, key);
String[] values = RowMutation.getColumnAndColumnFamily(cf);
|
public void doVerb(Message message)
{
byte[] bytes = message.getMessageBody();
/* Obtain a Row Mutation Context from TLS */
RowMutationContext rowMutationCtx = tls_.get();
if ( rowMutationCtx == null )
{
rowMutationCtx = new RowMutationContext();
... | public void doVerb(Message message)
{
byte[] bytes = message.getMessageBody();
/* Obtain a Row Mutation Context from TLS */
RowMutationContext rowMutationCtx = tls_.get();
if ( rowMutationCtx == null )
{
rowMutationCtx = new RowMutationContext();
... |
public void testStressAdvance() throws Exception {
for(int iter=0;iter<3;iter++) {
if (VERBOSE) {
System.out.println("\nTEST: iter=" + iter);
}
Directory dir = newDirectory();
RandomIndexWriter w = new RandomIndexWriter(random, dir);
final Set<Integer> aDocs = new HashSet<Int... | public void testStressAdvance() throws Exception {
for(int iter=0;iter<3;iter++) {
if (VERBOSE) {
System.out.println("\nTEST: iter=" + iter);
}
Directory dir = newDirectory();
RandomIndexWriter w = new RandomIndexWriter(random, dir);
final Set<Integer> aDocs = new HashSet<Int... |
public IndexFileDeleter(Directory directory, IndexDeletionPolicy policy, SegmentInfos segmentInfos, PrintStream infoStream, IndexWriter writer)
throws CorruptIndexException, IOException {
this.infoStream = infoStream;
this.writer = writer;
final String currentSegmentsFile = segmentInfos.getCurrentSe... | public IndexFileDeleter(Directory directory, IndexDeletionPolicy policy, SegmentInfos segmentInfos, PrintStream infoStream, IndexWriter writer)
throws CorruptIndexException, IOException {
this.infoStream = infoStream;
this.writer = writer;
final String currentSegmentsFile = segmentInfos.getCurrentSe... |
private EmbedXAResource associatedResource;
final XAXactId xid;
/**
When an XAResource suspends a transaction (end(TMSUSPEND)) it must be resumed
using the same XAConnection. This has been the traditional Cloudscape behaviour,
though there does not seem to be a specific reference to this behaviour in
| private EmbedXAResource associatedResource;
final XAXactId xid;
/**
When an XAResource suspends a transaction (end(TMSUSPEND)) it must be resumed
using the same XAConnection. This has been the traditional Cloudscape/Derby behaviour,
though there does not seem to be a specific reference to this behaviour i... |
An interface for accessing Derby UUIDs, unique identifiers.
/*
Derby - Class org.apache.derby.catalog.UUID
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright owne... | An interface for accessing Derby UUIDs, unique identifiers.
/*
Derby - Class org.apache.derby.catalog.UUID
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright owne... |
and is used internally by the Derby optimizer to estimate cost
/*
Derby - Class org.apache.derby.catalog.Statistics
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyr... | and is used internally by the Derby optimizer to estimate cost
/*
Derby - Class org.apache.derby.catalog.Statistics
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyr... |
public void testCommitWithin() throws Exception
{
// make sure it is empty...
SolrServer server = getSolrServer();
server.deleteByQuery( "*:*" );// delete everything!
server.commit();
QueryResponse rsp = server.query( new SolrQuery( "*:*") );
Assert.assertEquals( 0, rsp.getResults().getN... | public void testCommitWithin() throws Exception
{
// make sure it is empty...
SolrServer server = getSolrServer();
server.deleteByQuery( "*:*" );// delete everything!
server.commit();
QueryResponse rsp = server.query( new SolrQuery( "*:*") );
Assert.assertEquals( 0, rsp.getResults().getN... |
public SolrCore create(CoreDescriptor dcore) throws ParserConfigurationException, IOException, SAXException {
// Make the instanceDir relative to the cores instanceDir if not absolute
File idir = new File(dcore.getInstanceDir());
if (!idir.isAbsolute()) {
idir = new File(solrHome, dcore.getInstance... | public SolrCore create(CoreDescriptor dcore) throws ParserConfigurationException, IOException, SAXException {
// Make the instanceDir relative to the cores instanceDir if not absolute
File idir = new File(dcore.getInstanceDir());
if (!idir.isAbsolute()) {
idir = new File(solrHome, dcore.getInstance... |
public TopFieldDocs call() throws IOException {
assert slice.leaves.length == 1;
final TopFieldDocs docs = searcher.search(Arrays.asList(slice.leaves),
weight, after, nDocs, sort, true, doDocScores, doMaxScore);
lock.lock();
try {
final AtomicReaderContext ctx = slice.leave... | public TopFieldDocs call() throws IOException {
assert slice.leaves.length == 1;
final TopFieldDocs docs = searcher.search(Arrays.asList(slice.leaves),
weight, after, nDocs, sort, true, doDocScores || sort.needsScores(), doMaxScore);
lock.lock();
try {
final AtomicReaderCon... |
public Object run() throws Exception
{
switch( actionCode)
{
case BOOT_ACTION:
readOnly = storageFactory.isReadOnlyDatabase();
supportsRandomAccess = storageFactory.supportsRandomAccess();
return null;
case GET_TEMP_DIRECTORY_ACTIO... | public Object run() throws Exception
{
switch( actionCode)
{
case BOOT_ACTION:
readOnly = storageFactory.isReadOnlyDatabase();
supportsRandomAccess = storageFactory.supportsRandomAccess();
return null;
case GET_TEMP_DIRECTORY_ACTIO... |
public void run() {
final Document doc = new Document();
doc.add(newField(r, "content1", "aaa bbb ccc ddd", Field.Store.YES, Field.Index.ANALYZED));
doc.add(newField(r, "content6", "aaa bbb ccc ddd", Field.Store.NO, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS));
doc.add(n... | public void run() {
final Document doc = new Document();
doc.add(newField(r, "content1", "aaa bbb ccc ddd", Field.Store.YES, Field.Index.ANALYZED));
doc.add(newField(r, "content6", "aaa bbb ccc ddd", Field.Store.NO, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS));
doc.add(n... |
public void run() {
try {
for (int i = 0; i < atLeast(100); ++i) {
final int idx = random().nextInt(numDocs);
final int docID = docID(reader, ""+idx);
assertEquals(docs[idx], reader.getTermVectors(docID));
}
} ... | public void run() {
try {
for (int i = 0; i < atLeast(100); ++i) {
final int idx = random().nextInt(numDocs);
final int docID = docID(reader, ""+idx);
assertEquals(docs[idx], reader.getTermVectors(docID));
}
} ... |
public CompressedRandomAccessReader(String dataFilePath, CompressionMetadata metadata, boolean skipIOCache) throws IOException
{
super(new File(dataFilePath), metadata.chunkLength, skipIOCache);
this.metadata = metadata;
compressed = new byte[metadata.chunkLength];
// can't use s... | public CompressedRandomAccessReader(String dataFilePath, CompressionMetadata metadata, boolean skipIOCache) throws IOException
{
super(new File(dataFilePath), metadata.chunkLength, skipIOCache);
this.metadata = metadata;
compressed = new byte[Snappy.maxCompressedLength(metadata.chunkLeng... |
private void handleMinorRevisionChange(TransactionController tc, DD_Version fromVersion, boolean softUpgradeRun)
throws StandardException
{
boolean isReadOnly = bootingDictionary.af.isReadOnly();
if (!isReadOnly) {
// Once a database is version 10.5 we will start updating metadata SPSes
// on any versio... | private void handleMinorRevisionChange(TransactionController tc, DD_Version fromVersion, boolean softUpgradeRun)
throws StandardException
{
boolean isReadOnly = bootingDictionary.af.isReadOnly();
if (!isReadOnly) {
// Once a database is version 10.5 we will start updating metadata SPSes
// on any versio... |
public TupleDescriptor buildDescriptor(
ExecRow row,
TupleDescriptor parentTupleDescriptor,
DataDictionary dd )
throws StandardException
{
DataValueDescriptor col;
SPSDescriptor descriptor;
String name;
String text;
String usingText;
UUID uuid;
UUID comp... | public TupleDescriptor buildDescriptor(
ExecRow row,
TupleDescriptor parentTupleDescriptor,
DataDictionary dd )
throws StandardException
{
DataValueDescriptor col;
SPSDescriptor descriptor;
String name;
String text;
String usingText;
UUID uuid;
UUID comp... |
public static void main(String[] args) throws IOException {
DefaultOptionBuilder obuilder = new DefaultOptionBuilder();
ArgumentBuilder abuilder = new ArgumentBuilder();
GroupBuilder gbuilder = new GroupBuilder();
Option inputOpt = obuilder.withLongName("dir").withRequired(true).withArgument(
... | public static void main(String[] args) throws IOException {
DefaultOptionBuilder obuilder = new DefaultOptionBuilder();
ArgumentBuilder abuilder = new ArgumentBuilder();
GroupBuilder gbuilder = new GroupBuilder();
Option inputOpt = obuilder.withLongName("dir").withRequired(true).withArgument(
... |
protected ColumnFamily readColumnFamily(ReadCommand command, int consistency_level) throws InvalidRequestException
{
String cfName = command.getColumnFamilyName();
ThriftValidation.validateKey(command.key);
if (consistency_level == ConsistencyLevel.ZERO)
{
throw new ... | protected ColumnFamily readColumnFamily(ReadCommand command, int consistency_level) throws InvalidRequestException
{
String cfName = command.getColumnFamilyName();
ThriftValidation.validateKey(command.key);
if (consistency_level == ConsistencyLevel.ZERO)
{
throw new ... |
public void testExactFileNames() throws IOException {
String outputDir = "lucene.backwardscompat0.index";
rmDir(outputDir);
try {
Directory dir = FSDirectory.open(new File(fullDir(outputDir)));
IndexWriter writer = new IndexWriter(dir, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLen... | public void testExactFileNames() throws IOException {
String outputDir = "lucene.backwardscompat0.index";
rmDir(outputDir);
try {
Directory dir = FSDirectory.open(new File(fullDir(outputDir)));
IndexWriter writer = new IndexWriter(dir, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLen... |
public void testBasic() throws Exception {
Replicator replicator = new HttpReplicator("localhost", port, ReplicationService.REPLICATION_CONTEXT + "/s1",
getClientConnectionManager());
ReplicationClient client = new ReplicationClient(replicator, new IndexReplicationHandler(handlerIndexDir, null),
... | public void testBasic() throws Exception {
Replicator replicator = new HttpReplicator("127.0.0.1", port, ReplicationService.REPLICATION_CONTEXT + "/s1",
getClientConnectionManager());
ReplicationClient client = new ReplicationClient(replicator, new IndexReplicationHandler(handlerIndexDir, null),
... |
public String evaluate(String expression, Context context) {
List<Object> l = parseParams(expression, context.getVariableResolver());
if (l.size() < 2 || l.size() > 3) {
throw new DataImportHandlerException(SEVERE, "'formatDate()' must have two or three parameters ");
}
Object o = l.get(0);
... | public String evaluate(String expression, Context context) {
List<Object> l = parseParams(expression, context.getVariableResolver());
if (l.size() < 2 || l.size() > 3) {
throw new DataImportHandlerException(SEVERE, "'formatDate()' must have two or three parameters ");
}
Object o = l.get(0);
... |
public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException {
// RESOLVE other properties should be added into this method in the future ...
if (info != null) {
if (Boolean.valueOf(info.getProperty(Attribute.SHUTDOWN_ATTR)).booleanValue()) {
// no other options p... | public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException {
// RESOLVE other properties should be added into this method in the future ...
if (info != null) {
if (Boolean.valueOf(info.getProperty(Attribute.SHUTDOWN_ATTR)).booleanValue()) {
// no other options p... |
public void generateExpression(ExpressionClassBuilder acb,
MethodBuilder mb)
throws StandardException
{
int nargs = 0;
String receiverType = null;
/* Allocate an object for re-use to hold the result of the operator */
LocalField field = acb.newFieldDeclaration(Modifier.PRIVATE, resultInterfaceTy... | public void generateExpression(ExpressionClassBuilder acb,
MethodBuilder mb)
throws StandardException
{
int nargs = 0;
String receiverType = null;
/* Allocate an object for re-use to hold the result of the operator */
LocalField field = acb.newFieldDeclaration(Modifier.PRIVATE, resultInterfaceTy... |
public void testCanopyEuclideanMRJobNoClustering() throws Exception {
Path input = getTestTempDirPath("testdata");
Configuration conf = new Configuration();
FileSystem fs = FileSystem.get(input.toUri(), conf);
Collection<VectorWritable> points = Lists.newArrayList();
for (Vector v : raw) {
p... | public void testCanopyEuclideanMRJobNoClustering() throws Exception {
Path input = getTestTempDirPath("testdata");
Configuration conf = new Configuration();
FileSystem fs = FileSystem.get(input.toUri(), conf);
Collection<VectorWritable> points = Lists.newArrayList();
for (Vector v : raw) {
p... |
public void testIterableThrowsException() throws IOException {
Directory dir = newDirectory();
IndexWriter w = new IndexWriter(dir, newIndexWriterConfig(
TEST_VERSION_CURRENT, new MockAnalyzer(random())));
int iters = atLeast(100);
int docCount = 0;
int docId = 0;
Set<String> liveIds =... | public void testIterableThrowsException() throws IOException {
Directory dir = newDirectory();
IndexWriter w = new IndexWriter(dir, newIndexWriterConfig(
TEST_VERSION_CURRENT, new MockAnalyzer(random())));
int iters = atLeast(100);
int docCount = 0;
int docId = 0;
Set<String> liveIds =... |
private AbstractJdbcType<?> getNameType(String keyspace, String columnFamily, ByteBuffer name)
{
CFamMeta cf = metadata.get(String.format("%s.%s", keyspace, columnFamily));
try
{
if (ByteBufferUtil.string(name).equalsIgnoreCase(ByteBufferUtil.string(cf.keyAlias)))
... | private AbstractJdbcType<?> getNameType(String keyspace, String columnFamily, ByteBuffer name)
{
CFamMeta cf = metadata.get(String.format("%s.%s", keyspace, columnFamily));
try
{
if (ByteBufferUtil.string(name).equalsIgnoreCase(ByteBufferUtil.string(cf.keyAlias)))
... |
private static SimpleOrderedMap<Object> getIndexedFieldsInfo(
final SolrIndexSearcher searcher, final Set<String> fields, final int numTerms )
throws Exception {
Query matchAllDocs = new MatchAllDocsQuery();
SolrQueryParser qp = searcher.getSchema().getSolrQueryParser(null);
IndexReader reader ... | private static SimpleOrderedMap<Object> getIndexedFieldsInfo(
final SolrIndexSearcher searcher, final Set<String> fields, final int numTerms )
throws Exception {
Query matchAllDocs = new MatchAllDocsQuery();
SolrQueryParser qp = searcher.getSchema().getSolrQueryParser(null);
IndexReader reader ... |
public String getInfo()
{
return super.getInfo() + "\t" +
this.resultCode + "\t" +
this.mimeType + "\t" +
this.size + "\t" +
"\"" + this.title.replace('\"', (char)0xff ).replace('\n',' ').replace('\r',' ') + "\"";
}
| public String getInfo()
{
return super.getInfo() + "\t" +
this.resultCode + "\t" +
this.mimeType + "\t" +
this.size + "\t" +
"\"" + this.title.replace('\t',' ').replace('\"', (char)0xff ).replace('\n',' ').replace('\r',' ') + "\"";
}
|
public static long[] getTopUsers(int howMany,
LongPrimitiveIterator allUserIDs,
IDRescorer rescorer,
Estimator<Long> estimator) throws TasteException {
Queue<SimilarUser> topUsers = new PriorityQueue<SimilarUs... | public static long[] getTopUsers(int howMany,
LongPrimitiveIterator allUserIDs,
IDRescorer rescorer,
Estimator<Long> estimator) throws TasteException {
Queue<SimilarUser> topUsers = new PriorityQueue<SimilarUs... |
public void testMostSimilar() throws Exception {
UserBasedRecommender recommender = buildRecommender();
long[] similar = recommender.mostSimilarUserIDs(1, 2);
assertNotNull(similar);
assertEquals(2, similar.length);
assertEquals(2, similar[0]);
assertEquals(4, similar[1]);
}
| public void testMostSimilar() throws Exception {
UserBasedRecommender recommender = buildRecommender();
long[] similar = recommender.mostSimilarUserIDs(1, 2);
assertNotNull(similar);
assertEquals(2, similar.length);
assertEquals(2, similar[0]);
assertEquals(3, similar[1]);
}
|
public void testAutomaticDeprecationSupport()
{
// make sure the "admin/file" handler is registered
ShowFileRequestHandler handler = (ShowFileRequestHandler) h.getCore().getRequestHandler( "admin/file" );
assertTrue( "file handler should have been automatically registered", handler!=null );
//Syste... | public void testAutomaticDeprecationSupport()
{
// make sure the "admin/file" handler is registered
ShowFileRequestHandler handler = (ShowFileRequestHandler) h.getCore().getRequestHandler( "/admin/file" );
assertTrue( "file handler should have been automatically registered", handler!=null );
//Syst... |
public static void main(String[] args) throws Exception {
DefaultOptionBuilder obuilder = new DefaultOptionBuilder();
ArgumentBuilder abuilder = new ArgumentBuilder();
GroupBuilder gbuilder = new GroupBuilder();
Option seqOpt = obuilder.withLongName("seqFile").withRequired(false).withArgument(
... | public static void main(String[] args) throws Exception {
DefaultOptionBuilder obuilder = new DefaultOptionBuilder();
ArgumentBuilder abuilder = new ArgumentBuilder();
GroupBuilder gbuilder = new GroupBuilder();
Option seqOpt = obuilder.withLongName("seqFile").withRequired(false).withArgument(
... |
public void doVerb(Message message)
{
byte[] body = message.getMessageBody();
ByteArrayInputStream bufIn = new ByteArrayInputStream(body);
if (logger.isDebugEnabled())
logger.debug(String.format("StreamInitiateVerbeHandler.doVerb %s %s %s", message.getVerb(), message.getMessa... | public void doVerb(Message message)
{
byte[] body = message.getMessageBody();
ByteArrayInputStream bufIn = new ByteArrayInputStream(body);
if (logger.isDebugEnabled())
logger.debug(String.format("StreamInitiateVerbeHandler.doVerb %s %s %s", message.getVerb(), message.getMessa... |
public static String parseRoleId(String roleName) throws StandardException
{
roleName.trim();
// NONE is a special case and is not allowed with its special
// meaning in SET ROLE <value specification>. Even if there is
// a role with case normal form "NONE", we require it to be
// delimited here, since it w... | public static String parseRoleId(String roleName) throws StandardException
{
roleName = roleName.trim();
// NONE is a special case and is not allowed with its special
// meaning in SET ROLE <value specification>. Even if there is
// a role with case normal form "NONE", we require it to be
// delimited here,... |
public void testMaxByteNorms() throws IOException {
Directory dir = newFSDirectory(_TestUtil.getTempDir("TestNorms.testMaxByteNorms"));
buildIndex(dir);
AtomicReader open = SlowCompositeReaderWrapper.wrap(DirectoryReader.open(dir));
NumericDocValues normValues = open.simpleNormValues(byteTestField);
... | public void testMaxByteNorms() throws IOException {
Directory dir = newFSDirectory(_TestUtil.getTempDir("TestNorms.testMaxByteNorms"));
buildIndex(dir);
AtomicReader open = SlowCompositeReaderWrapper.wrap(DirectoryReader.open(dir));
NumericDocValues normValues = open.simpleNormValues(byteTestField);
... |
public void set(int index, double value) {
if (index >= 0 && index < size()) {
setQuick(index, value);
} else {
throw new IndexException();
}
}
| public void set(int index, double value) {
if (index >= 0 && index < size()) {
setQuick(index, value);
} else {
throw new IndexException(index, size());
}
}
|
public Matrix times(Matrix other) {
int[] c = size();
int[] o = other.size();
if (c[COL] != o[ROW]) {
throw new CardinalityException();
}
Matrix result = like(c[ROW], o[COL]);
for (int row = 0; row < c[ROW]; row++) {
for (int col = 0; col < o[COL]; col++) {
double sum = 0;
... | public Matrix times(Matrix other) {
int[] c = size();
int[] o = other.size();
if (c[COL] != o[ROW]) {
throw new CardinalityException(c[COL], o[ROW]);
}
Matrix result = like(c[ROW], o[COL]);
for (int row = 0; row < c[ROW]; row++) {
for (int col = 0; col < o[COL]; col++) {
do... |
public void addTo(Vector v) {
if (v.size() != size()) {
throw new CardinalityException();
}
values.forEachPair(new AddToVector(v));
}
| public void addTo(Vector v) {
if (v.size() != size()) {
throw new CardinalityException(size(), v.size());
}
values.forEachPair(new AddToVector(v));
}
|
public void before() throws IOException {
configuration = new Configuration();
}
| public void before() throws IOException {
configuration = getConfiguration();
}
|
public void before() throws IOException {
lucene2seq = new SequenceFilesFromLuceneStorageMRJob();
Configuration configuration = new Configuration();
Path seqOutputPath = new Path(getTestTempDirPath(), "seqOutputPath");//don't make the output directory
lucene2SeqConf = new LuceneStorageConfiguration(co... | public void before() throws IOException {
lucene2seq = new SequenceFilesFromLuceneStorageMRJob();
Configuration configuration = getConfiguration();
Path seqOutputPath = new Path(getTestTempDirPath(), "seqOutputPath");//don't make the output directory
lucene2SeqConf = new LuceneStorageConfiguration(con... |
public void before() throws IOException {
configuration = new Configuration();
seqFilesOutputPath = new Path(getTestTempDirPath(), "seqfiles");
lucene2Seq = new SequenceFilesFromLuceneStorage();
lucene2SeqConf = new LuceneStorageConfiguration(configuration,
asList(getIndexPath1(), getIndexPath2... | public void before() throws IOException {
configuration = getConfiguration();
seqFilesOutputPath = new Path(getTestTempDirPath(), "seqfiles");
lucene2Seq = new SequenceFilesFromLuceneStorage();
lucene2SeqConf = new LuceneStorageConfiguration(configuration,
asList(getIndexPath1(), getIndexPath2(... |
public void testConcatenateVectorsReducer() throws Exception {
Configuration configuration = new Configuration();
configuration.set(ConcatenateVectorsJob.MATRIXA_DIMS, "5");
configuration.set(ConcatenateVectorsJob.MATRIXB_DIMS, "3");
// Yes, all of this generic rigmarole is needed, and woe b... | public void testConcatenateVectorsReducer() throws Exception {
Configuration configuration = getConfiguration();
configuration.set(ConcatenateVectorsJob.MATRIXA_DIMS, "5");
configuration.set(ConcatenateVectorsJob.MATRIXB_DIMS, "3");
// Yes, all of this generic rigmarole is needed, and woe be... |
public void testSFVW() throws Exception {
Path path = getTestTempFilePath("sfvw");
Configuration conf = new Configuration();
FileSystem fs = FileSystem.get(conf);
SequenceFile.Writer seqWriter = new SequenceFile.Writer(fs, conf, path, LongWritable.class, VectorWritable.class);
SequenceFileVectorWr... | public void testSFVW() throws Exception {
Path path = getTestTempFilePath("sfvw");
Configuration conf = getConfiguration();
FileSystem fs = FileSystem.get(conf);
SequenceFile.Writer seqWriter = new SequenceFile.Writer(fs, conf, path, LongWritable.class, VectorWritable.class);
SequenceFileVectorWri... |
public void setUp() throws Exception {
super.setUp();
indexDir = getTestTempDir("intermediate");
indexDir.delete();
outputDir = getTestTempDir("output");
outputDir.delete();
conf = new Configuration();
}
| public void setUp() throws Exception {
super.setUp();
indexDir = getTestTempDir("intermediate");
indexDir.delete();
outputDir = getTestTempDir("output");
outputDir.delete();
conf = getConfiguration();
}
|
public void setUp() throws Exception {
super.setUp();
inputFile = getTestTempFile("prefs.txt");
intermediateDir = getTestTempDir("intermediate");
intermediateDir.delete();
outputDir = getTestTempDir("output");
outputDir.delete();
tmpDir = getTestTempDir("tmp");
conf = new Configuratio... | public void setUp() throws Exception {
super.setUp();
inputFile = getTestTempFile("prefs.txt");
intermediateDir = getTestTempDir("intermediate");
intermediateDir.delete();
outputDir = getTestTempDir("output");
outputDir.delete();
tmpDir = getTestTempDir("tmp");
conf = getConfiguration... |
public void testMaxDistance() throws Exception {
Path input = getTestTempDirPath("input");
Path output = getTestTempDirPath("output");
Path seedsPath = getTestTempDirPath("seeds");
List<VectorWritable> points = getPointsWritable(REFERENCE);
List<VectorWritable> seeds = getPointsWritable(SEEDS);
... | public void testMaxDistance() throws Exception {
Path input = getTestTempDirPath("input");
Path output = getTestTempDirPath("output");
Path seedsPath = getTestTempDirPath("seeds");
List<VectorWritable> points = getPointsWritable(REFERENCE);
List<VectorWritable> seeds = getPointsWritable(SEEDS);
... |
public void runSSVDSolver(int q) throws IOException {
Configuration conf = new Configuration();
conf.set("mapred.job.tracker", "local");
conf.set("fs.default.name", "file:///");
// conf.set("mapred.job.tracker","localhost:11011");
// conf.set("fs.default.name","hdfs://localhost:11010/");
De... | public void runSSVDSolver(int q) throws IOException {
Configuration conf = getConfiguration();
conf.set("mapred.job.tracker", "local");
conf.set("fs.default.name", "file:///");
// conf.set("mapred.job.tracker","localhost:11011");
// conf.set("fs.default.name","hdfs://localhost:11010/");
Deq... |
public void runSSVDSolver(int q) throws IOException {
Configuration conf = new Configuration();
conf.set("mapred.job.tracker", "local");
conf.set("fs.default.name", "file:///");
// conf.set("mapred.job.tracker","localhost:11011");
// conf.set("fs.default.name","hdfs://localhost:11010/");
Fi... | public void runSSVDSolver(int q) throws IOException {
Configuration conf = getConfiguration();
conf.set("mapred.job.tracker", "local");
conf.set("fs.default.name", "file:///");
// conf.set("mapred.job.tracker","localhost:11011");
// conf.set("fs.default.name","hdfs://localhost:11010/");
Fil... |
public void testReduce() throws Exception {
LLRReducer reducer = new LLRReducer(ll);
// test input, input[*][0] is the key,
// input[*][1..n] are the values passed in via
// the iterator.
Gram[][] input = {
{new Gram("the best", 1, Gram.Type.NGRAM), new Gram("the", 2, Gram.... | public void testReduce() throws Exception {
LLRReducer reducer = new LLRReducer(ll);
// test input, input[*][0] is the key,
// input[*][1..n] are the values passed in via
// the iterator.
Gram[][] input = {
{new Gram("the best", 1, Gram.Type.NGRAM), new Gram("the", 2, Gram.... |
public void testUnitVectorizerMapper() throws Exception {
UnitVectorizerMapper mapper = new UnitVectorizerMapper();
Configuration conf = new Configuration();
// set up the dummy writers
DummyRecordWriter<IntWritable, VectorWritable> writer = new
DummyRecordWriter<IntWritable, VectorWritable... | public void testUnitVectorizerMapper() throws Exception {
UnitVectorizerMapper mapper = new UnitVectorizerMapper();
Configuration conf = getConfiguration();
// set up the dummy writers
DummyRecordWriter<IntWritable, VectorWritable> writer = new
DummyRecordWriter<IntWritable, VectorWritable>... |
public void testVectorMatrixMultiplicationMapper() throws Exception {
VectorMatrixMultiplicationMapper mapper = new VectorMatrixMultiplicationMapper();
Configuration conf = new Configuration();
// set up all the parameters for the job
Vector toSave = new DenseVector(VECTOR);
DummyRecordWriter... | public void testVectorMatrixMultiplicationMapper() throws Exception {
VectorMatrixMultiplicationMapper mapper = new VectorMatrixMultiplicationMapper();
Configuration conf = getConfiguration();
// set up all the parameters for the job
Vector toSave = new DenseVector(VECTOR);
DummyRecordWriter<... |
public void setUp() throws Exception {
super.setUp();
Configuration conf = new Configuration();
fs = FileSystem.get(conf);
}
| public void setUp() throws Exception {
super.setUp();
Configuration conf = getConfiguration();
fs = FileSystem.get(conf);
}
|
public void testProcessOutput() throws Exception {
Configuration conf = new Configuration();
conf.setInt("mapred.map.tasks", NUM_MAPS);
Random rng = RandomUtils.getRandom();
// prepare the output
TreeID[] keys = new TreeID[NUM_TREES];
MapredOutput[] values = new MapredOutput[NUM_TREES];
... | public void testProcessOutput() throws Exception {
Configuration conf = getConfiguration();
conf.setInt("mapred.map.tasks", NUM_MAPS);
Random rng = RandomUtils.getRandom();
// prepare the output
TreeID[] keys = new TreeID[NUM_TREES];
MapredOutput[] values = new MapredOutput[NUM_TREES];
i... |
public void setUp() throws Exception {
super.setUp();
configuration = new Configuration();
output = getTestTempDirPath();
}
| public void setUp() throws Exception {
super.setUp();
configuration = getConfiguration();
output = getTestTempDirPath();
}
|
public synchronized AEProvider getAEProvider(String core, String aePath,
Map<String, String> runtimeParameters) {
String key = new StringBuilder(core).append(aePath).toString();
if (providerCache.get(key) == null) {
providerCache.put(key, new OverridingParamsAEProvider(aePath, runtimeParameter... | public synchronized AEProvider getAEProvider(String core, String aePath,
Map<String, Object> runtimeParameters) {
String key = new StringBuilder(core).append(aePath).toString();
if (providerCache.get(key) == null) {
providerCache.put(key, new OverridingParamsAEProvider(aePath, runtimeParameter... |
public ValueNode bindExpression(
FromList fromList, SubqueryList subqueryList,
Vector aggregateVector)
throws StandardException
{
TypeId operandType;
super.bindExpression(fromList, subqueryList,
aggregateVector);
/*
** Check the type of the operand - this function is allowed only on
** string ... | public ValueNode bindExpression(
FromList fromList, SubqueryList subqueryList,
Vector aggregateVector)
throws StandardException
{
TypeId operandType;
bindOperand(fromList, subqueryList,
aggregateVector);
/*
** Check the type of the operand - this function is allowed only on
** string value (cha... |
public ValueNode bindExpression(
FromList fromList, SubqueryList subqueryList,
Vector aggregateVector)
throws StandardException
{
localCopyFromList = fromList;
localCopySubqueryList = subqueryList;
localAggregateVector = aggregateVector;
//Return with no binding, if the type of unary minus/plus paramet... | public ValueNode bindExpression(
FromList fromList, SubqueryList subqueryList,
Vector aggregateVector)
throws StandardException
{
localCopyFromList = fromList;
localCopySubqueryList = subqueryList;
localAggregateVector = aggregateVector;
//Return with no binding, if the type of unary minus/plus paramet... |
public static void delete(String dataFile)
{
/* remove the cached index table from memory */
indexMetadataMap_.remove(dataFile);
/* Delete the checksum file associated with this data file */
try
{
ChecksumManager.onFileDelete(dataFile);
}
catch... | public static void delete(String dataFile)
{
/* remove the cached index table from memory */
indexMetadataMap_.remove(dataFile);
/* Delete the checksum file associated with this data file */
try
{
ChecksumManager.onFileDelete(dataFile);
}
catch... |
public void forceFlushBinary()
{
if (memtable_.isClean())
return;
submitFlush(binaryMemtable_.get());
}
| public void forceFlushBinary()
{
if (binaryMemtable_.get().isClean())
return;
submitFlush(binaryMemtable_.get());
}
|
public synchronized void response(Message message)
{
try
{
String dataCenter = endpointSnitch.getLocation(message.getFrom());
Object blockFor = responseCounts.get(dataCenter);
// If this DC needs to be blocked then do the below.
if (blockFor != nul... | public synchronized void response(Message message)
{
try
{
String dataCenter = endpointSnitch.getDatacenter(message.getFrom());
Object blockFor = responseCounts.get(dataCenter);
// If this DC needs to be blocked then do the below.
if (blockFor != n... |
public void response(Message message)
{
//Is optimal to check if same datacenter than comparing Arrays.
int b = -1;
try
{
if (endpointsnitch.isInSameDataCenter(localEndpoint, message.getFrom()))
{
b = blockFor.decrementAndGet();
... | public void response(Message message)
{
//Is optimal to check if same datacenter than comparing Arrays.
int b = -1;
try
{
if (endpointsnitch.getDatacenter(localEndpoint).equals(endpointsnitch.getDatacenter(message.getFrom())))
{
b = blockFo... |
public void modifiedBundle(Bundle bundle, BundleEvent event, Object object) {
// If the bundle being stopped is the system bundle,
// do an orderly shutdown of all blueprint contexts now
// so that service usage can actually be useful
if (bundle.getBundleId() == 0 && bundle.getState(... | public void modifiedBundle(Bundle bundle, BundleEvent event, Object object) {
// If the bundle being stopped is the system bundle,
// do an orderly shutdown of all blueprint contexts now
// so that service usage can actually be useful
if (context.getBundle(0).equals(bundle) && bundle... |
public void testKSMetaDataSerialization() throws IOException
{
for (KSMetaData ksm : DatabaseDescriptor.tables_.values())
{
byte[] ser = KSMetaData.serialize(ksm);
KSMetaData ksmDupe = KSMetaData.deserialize(new ByteArrayInputStream(ser));
assert ksmDupe != n... | public void testKSMetaDataSerialization() throws IOException
{
for (KSMetaData ksm : DatabaseDescriptor.tables.values())
{
byte[] ser = KSMetaData.serialize(ksm);
KSMetaData ksmDupe = KSMetaData.deserialize(new ByteArrayInputStream(ser));
assert ksmDupe != nu... |
public void testReplication_Local_3_p5_DERBY_3878()
throws Exception
{
makeReadyForReplication();
// getDerbyServerPID = userDir +FS+ "getDerbyServerPID";
// mk_getDerbyServerPID_Cmd(getDerbyServerPID);
// Run a "load" on the master to make sure there
... | public void testReplication_Local_3_p5_DERBY_3878()
throws Exception
{
makeReadyForReplication();
// getDerbyServerPID = userDir +FS+ "getDerbyServerPID";
// mk_getDerbyServerPID_Cmd(getDerbyServerPID);
// Run a "load" on the master to make sure there
... |
public static void clusterData(Path input,
Path clustersIn,
Path output,
DistanceMeasure measure,
double convergenceDelta,
float m,
... | public static void clusterData(Path input,
Path clustersIn,
Path output,
DistanceMeasure measure,
double convergenceDelta,
float m,
... |
public static void massageSqlFile (String hostName, String fileName) throws Exception {
// only called if hostName is *not* localhost.
// Need to replace each occurrence of the string 'localhost' with
// whatever is the hostName
File tmpFile = new File("extin", "tmpFile.sql");
... | public static void massageSqlFile (String hostName, String fileName) throws Exception {
// only called if hostName is *not* localhost.
// Need to replace each occurrence of the string 'localhost' with
// whatever is the hostName
File tmpFile = new File("extin", "tmpFile.sql");
... |
private void copySegmentIntoCFS(SegmentInfo info, String segName, IOContext context) throws IOException {
String segFileName = IndexFileNames.segmentFileName(segName, "", IndexFileNames.COMPOUND_FILE_EXTENSION);
Collection<String> files = info.files();
final CompoundFileDirectory cfsdir = new CompoundFile... | private void copySegmentIntoCFS(SegmentInfo info, String segName, IOContext context) throws IOException {
String segFileName = IndexFileNames.segmentFileName(segName, "", IndexFileNames.COMPOUND_FILE_EXTENSION);
Collection<String> files = info.files();
final CompoundFileDirectory cfsdir = new CompoundFile... |
public void flush(SegmentWriteState state) throws IOException {
Map<FieldInfo, DocFieldConsumerPerField> childFields = new HashMap<FieldInfo, DocFieldConsumerPerField>();
Collection<DocFieldConsumerPerField> fields = fields();
for (DocFieldConsumerPerField f : fields) {
childFields.put(f.getFieldIn... | public void flush(SegmentWriteState state) throws IOException {
Map<FieldInfo, DocFieldConsumerPerField> childFields = new HashMap<FieldInfo, DocFieldConsumerPerField>();
Collection<DocFieldConsumerPerField> fields = fields();
for (DocFieldConsumerPerField f : fields) {
childFields.put(f.getFieldIn... |
public void testComplementIterator() throws Exception {
final int n = atLeast(10000);
final FixedBitSet bits = new FixedBitSet(n);
Random random = random();
for (int i = 0; i < n; i++) {
int idx = random.nextInt(n);
bits.flip(idx, idx + 1);
}
FixedBitSet verify = new FixedBitS... | public void testComplementIterator() throws Exception {
final int n = atLeast(10000);
final FixedBitSet bits = new FixedBitSet(n);
Random random = random();
for (int i = 0; i < n; i++) {
int idx = random.nextInt(n);
bits.flip(idx, idx + 1);
}
FixedBitSet verify = bits.clone();... |
private QueryBuilder getBuilder(QueryNode node) {
QueryBuilder builder = null;
if (this.fieldNameBuilders != null && node instanceof FieldableNode) {
CharSequence field = ((FieldableNode) node).getField();
if (field != null) {
field = field.toString();
}
builder = this.field... | private QueryBuilder getBuilder(QueryNode node) {
QueryBuilder builder = null;
if (this.fieldNameBuilders != null && node instanceof FieldableNode) {
CharSequence field = ((FieldableNode) node).getField();
if (field != null) {
field = field.toString();
}
builder = this.field... |
public QueryMaker getQueryMaker() {
return getRunData().getSearchQueryMaker();
}
| public QueryMaker getQueryMaker() {
return getRunData().getQueryMaker(this);
}
|
public static final long KEEPALIVE = 60; // seconds to keep "extra" threads alive for when idle
static
{
stages.put(MUTATION_STAGE, multiThreadedConfigurableStage(MUTATION_STAGE, getConcurrentWriters()));
stages.put(READ_STAGE, multiThreadedConfigurableStage(READ_STAGE, getConcurrentReaders... | public static final long KEEPALIVE = 60; // seconds to keep "extra" threads alive for when idle
static
{
stages.put(MUTATION_STAGE, multiThreadedConfigurableStage(MUTATION_STAGE, getConcurrentWriters()));
stages.put(READ_STAGE, multiThreadedConfigurableStage(READ_STAGE, getConcurrentReaders... |
public QueryTreeNode bind() throws StandardException
{
privileges = (PrivilegeNode) privileges.bind( new HashMap(), grantees);
return this;
} // end of bind
| public QueryTreeNode bind() throws StandardException
{
privileges = (PrivilegeNode) privileges.bind( new HashMap(), grantees, false);
return this;
} // end of bind
|
public QueryTreeNode bind() throws StandardException
{
privileges = (PrivilegeNode) privileges.bind( new HashMap(), grantees);
return this;
} // end of bind
| public QueryTreeNode bind() throws StandardException
{
privileges = (PrivilegeNode) privileges.bind( new HashMap(), grantees, true);
return this;
} // end of bind
|
public final PooledConnection getPooledConnection() throws SQLException {
return new EmbedPooledConnection(this, getUser(), getPassword(), false);
}
/**
Attempt to establish a database connection.
@param user the database user on whose behalf the Connection is being made
@param password the user's passwor... | public final PooledConnection getPooledConnection() throws SQLException {
return new EmbedPooledConnection(this, getUser(), getPassword(), false);
}
/**
Attempt to establish a database connection.
@param username the database user on whose behalf the Connection is being made
@param password the user's pas... |
public static void main(String[] args) throws Exception {
String usage =
"Usage: java org.apache.lucene.demo.SearchFiles [-index dir] [-field f] [-repeat n] [-queries file] [-raw] [-norms field]";
if (args.length > 0 && ("-h".equals(args[0]) || "-help".equals(args[0]))) {
System.out.println(usage)... | public static void main(String[] args) throws Exception {
String usage =
"Usage: java org.apache.lucene.demo.SearchFiles [-index dir] [-field f] [-repeat n] [-queries file] [-raw] [-norms field]";
if (args.length > 0 && ("-h".equals(args[0]) || "-help".equals(args[0]))) {
System.out.println(usage)... |
public static void merge(Directory srcIndexDir, Directory srcTaxDir,
OrdinalMap map, IndexWriter destIndexWriter,
DirectoryTaxonomyWriter destTaxWriter) throws IOException {
// merge the taxonomies
destTaxWriter.addTaxonomies(new Directory[] { srcTaxDir ... | public static void merge(Directory srcIndexDir, Directory srcTaxDir,
OrdinalMap map, IndexWriter destIndexWriter,
DirectoryTaxonomyWriter destTaxWriter) throws IOException {
// merge the taxonomies
destTaxWriter.addTaxonomy(srcTaxDir, map);
PayloadP... |
public void run() {
if (SanityManager.DEBUG)
trace("Starting new connection thread");
Session prevSession;
while(!closed())
{
// get a new session
prevSession = session;
session = server.getNextSession(session);
if (session == null)
close();
if (closed())
break;
if (session !... | public void run() {
if (SanityManager.DEBUG)
trace("Starting new connection thread");
Session prevSession;
while(!closed())
{
// get a new session
prevSession = session;
session = server.getNextSession(session);
if (session == null)
close();
if (closed())
break;
if (session !... |
private boolean isCryptoBoot(Properties p)
throws SQLException
{
return (isTrue(p, Attribute.DATA_ENCRYPTION) ||
vetTrue(p, Attribute.DECRYPT_DATABASE) ||
isSet(p, Attribute.NEW_BOOT_PASSWORD) ||
isSet(p, Attribute.NEW_CRYPTO_EXTERNAL_KEY));
}
| private boolean isCryptoBoot(Properties p)
throws SQLException
{
return (vetTrue(p, Attribute.DATA_ENCRYPTION) ||
vetTrue(p, Attribute.DECRYPT_DATABASE) ||
isSet(p, Attribute.NEW_BOOT_PASSWORD) ||
isSet(p, Attribute.NEW_CRYPTO_EXTERNAL_KEY));
}
|
public void iris() throws IOException {
// this test trains a 3-way classifier on the famous Iris dataset.
// a similar exercise can be accomplished in R using this code:
// library(nnet)
// correct = rep(0,100)
// for (j in 1:100) {
// i = order(runif(150))
// train = i... | public void iris() throws IOException {
// this test trains a 3-way classifier on the famous Iris dataset.
// a similar exercise can be accomplished in R using this code:
// library(nnet)
// correct = rep(0,100)
// for (j in 1:100) {
// i = order(runif(150))
// train = i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.