buggy_function stringlengths 1 391k | fixed_function stringlengths 0 392k |
|---|---|
protected Token process(Token t) throws IOException {
if ("A".equals(new String(t.termBuffer(), 0, t.termLength())) &&
"B".equals(new String(peek(1).termBuffer(), 0, peek(1).termLength())))
write(t);
return t;
}
| protected Token process(Token t) throws IOException {
if ("A".equals(new String(t.termBuffer(), 0, t.termLength())) &&
"B".equals(new String(peek(1).termBuffer(), 0, peek(1).termLength())))
write((Token)t.clone());
return t;
}
|
public void applyModels() throws IOException
{
// reinitialize the table.
KSMetaData existing = DatabaseDescriptor.getTableDefinition(tableName);
CFMetaData cfm = existing.cfMetaData().get(cfName);
KSMetaData ksm = makeNewKeyspaceDefinition(existing);
CFMetaData.purge(cfm... | public void applyModels() throws IOException
{
// reinitialize the table.
KSMetaData existing = DatabaseDescriptor.getTableDefinition(tableName);
CFMetaData cfm = existing.cfMetaData().get(cfName);
KSMetaData ksm = makeNewKeyspaceDefinition(existing);
CFMetaData.purge(cfm... |
public void applyModels()
{
// reinitialize the table.
KSMetaData ksm = DatabaseDescriptor.getTableDefinition(cfm.tableName);
ksm = makeNewKeyspaceDefinition(ksm);
Table.open(ksm.name).addCf(cfm.cfName);
DatabaseDescriptor.setTableDefinition(ksm, newVersion);
... | public void applyModels()
{
// reinitialize the table.
KSMetaData ksm = DatabaseDescriptor.getTableDefinition(cfm.tableName);
ksm = makeNewKeyspaceDefinition(ksm);
Table.open(ksm.name).initCf(cfm.cfId, cfm.cfName);
DatabaseDescriptor.setTableDefinition(ksm, newVersion);
... |
public void applyModels() throws IOException
{
KSMetaData ksm = DatabaseDescriptor.getTableDefinition(name);
// remove the table from the static instances.
Table table = Table.clear(ksm.name);
if (table == null)
throw new IOException("Table is not active. " + ksm.name... | public void applyModels() throws IOException
{
KSMetaData ksm = DatabaseDescriptor.getTableDefinition(name);
// remove the table from the static instances.
Table table = Table.clear(ksm.name);
if (table == null)
throw new IOException("Table is not active. " + ksm.name... |
private void readIndexedColumns(CFMetaData metadata, FileDataInput file, SortedSet<ByteBuffer> columnNames, List<ByteBuffer> filteredColumnNames, List<IndexHelper.IndexInfo> indexList)
throws IOException
{
file.readInt(); // column count
/* get the various column ranges we have to read */
... | private void readIndexedColumns(CFMetaData metadata, FileDataInput file, SortedSet<ByteBuffer> columnNames, List<ByteBuffer> filteredColumnNames, List<IndexHelper.IndexInfo> indexList)
throws IOException
{
file.readInt(); // column count
/* get the various column ranges we have to read */
... |
private static String[] getTableAndCFNames(ByteBuffer joined)
{
int index;
index = ArrayUtils.lastIndexOf(joined.array(), SEPARATOR.getBytes()[0],joined.position()+joined.arrayOffset());
if (index < 1)
throw new RuntimeException("Corrupted hint name " + joined.toString());
... | private static String[] getTableAndCFNames(ByteBuffer joined)
{
int index;
index = ArrayUtils.lastIndexOf(joined.array(), SEPARATOR.getBytes()[0],joined.position()+joined.arrayOffset());
if (index < 1)
throw new RuntimeException("Corrupted hint name " + joined.toString());
... |
private void writeConnected(ByteBuffer bb)
{
try
{
output.write(bb.array(), 0, bb.limit());
if (queue.peek() == null)
{
output.flush();
}
}
catch (IOException e)
{
logger.info("error writing to " ... | private void writeConnected(ByteBuffer bb)
{
try
{
output.write(bb.array(), bb.position()+bb.arrayOffset(), bb.limit()+bb.arrayOffset());
if (queue.peek() == null)
{
output.flush();
}
}
catch (IOException e)
... |
public static String guid() {
ByteBuffer array = guidAsBytes();
StringBuilder sb = new StringBuilder();
for (int j = array.position()+array.arrayOffset(); j < array.limit(); ++j) {
int b = array.array()[j] & 0xFF;
if (b < 0x10) sb.append('0');
sb.... | public static String guid() {
ByteBuffer array = guidAsBytes();
StringBuilder sb = new StringBuilder();
for (int j = array.position()+array.arrayOffset(); j < array.limit()+array.arrayOffset(); ++j) {
int b = array.array()[j] & 0xFF;
if (b < 0x10) sb.append('... |
public void testRepresentativePoints() throws Exception {
ClusteringTestUtils.writePointsToFile(referenceData, new Path(testdata, "file1"), fs, conf);
DistanceMeasure measure = new EuclideanDistanceMeasure();
Configuration conf = new Configuration();
// run using MR reference point calculation
Can... | public void testRepresentativePoints() throws Exception {
ClusteringTestUtils.writePointsToFile(referenceData, new Path(testdata, "file1"), fs, conf);
DistanceMeasure measure = new EuclideanDistanceMeasure();
Configuration conf = getConfiguration();
// run using MR reference point calculation
Cano... |
public void testTokenizeDocuments() throws Exception {
Configuration configuration = new Configuration();
Path input = new Path(getTestTempDirPath(), "inputDir");
Path output = new Path(getTestTempDirPath(), "outputDir");
FileSystem fs = FileSystem.get(input.toUri(), configuration);
String docume... | public void testTokenizeDocuments() throws Exception {
Configuration configuration = getConfiguration();
Path input = new Path(getTestTempDirPath(), "inputDir");
Path output = new Path(getTestTempDirPath(), "outputDir");
FileSystem fs = FileSystem.get(input.toUri(), configuration);
String documen... |
public void setUp() throws Exception {
super.setUp();
conf = new Configuration();
fs = FileSystem.get(conf);
}
| public void setUp() throws Exception {
super.setUp();
conf = getConfiguration();
fs = FileSystem.get(conf);
}
|
public void setUp() throws Exception {
super.setUp();
conf = new Configuration();
inputFile = getTestTempFile("trainingInstances.seq");
outputDir = getTestTempDir("output");
outputDir.delete();
tempDir = getTestTempDir("tmp");
SequenceFile.Writer writer = new SequenceFile.Writer(FileSys... | public void setUp() throws Exception {
super.setUp();
conf = getConfiguration();
inputFile = getTestTempFile("trainingInstances.seq");
outputDir = getTestTempDir("output");
outputDir.delete();
tempDir = getTestTempDir("tmp");
SequenceFile.Writer writer = new SequenceFile.Writer(FileSyst... |
public void setUp() throws Exception {
super.setUp();
conf = new Configuration();
}
| public void setUp() throws Exception {
super.setUp();
conf = getConfiguration();
}
|
private long testIndexingWithSuss(long docId) throws Exception {
ConcurrentUpdateSolrServer suss = new ConcurrentUpdateSolrServer(
((HttpSolrServer) clients.get(0)).getBaseURL(), 10, 2);
QueryResponse results = query(cloudClient);
long beforeCount = results.getResults().getNumFound();
int cnt ... | private long testIndexingWithSuss(long docId) throws Exception {
ConcurrentUpdateSolrServer suss = new ConcurrentUpdateSolrServer(
((HttpSolrServer) clients.get(0)).getBaseURL(), 10, 2);
QueryResponse results = query(cloudClient);
long beforeCount = results.getResults().getNumFound();
int cnt ... |
public static void transferSSTables(InetAddress target, List<SSTableReader> sstables, String table) throws IOException
{
PendingFile[] pendingFiles = new PendingFile[SSTable.FILES_ON_DISK * sstables.size()];
int i = 0;
for (SSTableReader sstable : sstables)
{
for (Str... | public static void transferSSTables(InetAddress target, List<SSTableReader> sstables, String table) throws IOException
{
PendingFile[] pendingFiles = new PendingFile[SSTable.FILES_ON_DISK * sstables.size()];
int i = 0;
for (SSTableReader sstable : sstables)
{
for (Str... |
public final boolean skipTo(int target)
throws IOException
{
while (target > _termPositionsQueue.peek().doc())
{
TermPositions tp = (TermPositions)_termPositionsQueue.pop();
if (tp.skipTo(target))
_termPositionsQueue.put(tp);
else
tp.close();
}
| public final boolean skipTo(int target)
throws IOException
{
while (_termPositionsQueue.peek() != null && target > _termPositionsQueue.peek().doc())
{
TermPositions tp = (TermPositions)_termPositionsQueue.pop();
if (tp.skipTo(target))
_termPositionsQueue.put(tp);
else
tp.close();
}
|
public void testMVSeparator() throws Exception {
makeIndexShortMV();
FieldQuery fq = new FieldQuery( tq( "d" ), true, true );
FieldTermStack stack = new FieldTermStack( reader, 0, F, fq );
FieldPhraseList fpl = new FieldPhraseList( stack, fq );
SimpleFragListBuilder sflb = new SimpleFragListBuild... | public void testMVSeparator() throws Exception {
makeIndexShortMV();
FieldQuery fq = new FieldQuery( tq( "d" ), true, true );
FieldTermStack stack = new FieldTermStack( reader, 0, F, fq );
FieldPhraseList fpl = new FieldPhraseList( stack, fq );
SimpleFragListBuilder sflb = new SimpleFragListBuild... |
protected void executeSPS(SPSDescriptor sps) throws StandardException
{
boolean recompile = false;
while (true) {
/*
** Only grab the ps the 1st time through. This
** way a row trigger doesn't do any unnecessary
** setup work.
*/
if (ps == null || recompile)
{
/*
** We need to clone... | protected void executeSPS(SPSDescriptor sps) throws StandardException
{
boolean recompile = false;
while (true) {
/*
** Only grab the ps the 1st time through. This
** way a row trigger doesn't do any unnecessary
** setup work.
*/
if (ps == null || recompile)
{
/*
** We need to clone... |
private final int getIndexOffset(Term term) {
int lo = 0; // binary search indexTerms[]
int hi = indexTerms.length - 1;
while (hi >= lo) {
int mid = (lo + hi) >> 1;
int delta = term.compareTo(indexTerms[mid]);
if (delta < 0)
hi = mid - 1;
else if (delta > 0)
lo = mid + 1;
... | private final int getIndexOffset(Term term) {
int lo = 0; // binary search indexTerms[]
int hi = indexTerms.length - 1;
while (hi >= lo) {
int mid = (lo + hi) >>> 1;
int delta = term.compareTo(indexTerms[mid]);
if (delta < 0)
hi = mid - 1;
else if (delta > 0)
lo = mid + 1;... |
public int remap(int oldDocID) {
if (oldDocID < minDocID)
// Unaffected by merge
return oldDocID;
else if (oldDocID >= maxDocID)
// This doc was "after" the merge, so simple shift
return oldDocID - docShift;
else {
// Binary search to locate this document & find its new docID... | public int remap(int oldDocID) {
if (oldDocID < minDocID)
// Unaffected by merge
return oldDocID;
else if (oldDocID >= maxDocID)
// This doc was "after" the merge, so simple shift
return oldDocID - docShift;
else {
// Binary search to locate this document & find its new docID... |
private int readerIndex(int n) { // find reader for doc n:
return readerIndex(n, this.starts, this.subReaders.length);
}
final static int readerIndex(int n, int[] starts, int numSubReaders) { // find reader for doc n:
int lo = 0; // search starts array
int... | private int readerIndex(int n) { // find reader for doc n:
return readerIndex(n, this.starts, this.subReaders.length);
}
final static int readerIndex(int n, int[] starts, int numSubReaders) { // find reader for doc n:
int lo = 0; // search starts array
int... |
public int subSearcher(int n) { // find searcher for doc n:
// replace w/ call to Arrays.binarySearch in Java 1.2
int lo = 0; // search starts array
int hi = searchables.length - 1; // for first element less
// than n, return its index
while (hi >= lo) {
int mid ... | public int subSearcher(int n) { // find searcher for doc n:
// replace w/ call to Arrays.binarySearch in Java 1.2
int lo = 0; // search starts array
int hi = searchables.length - 1; // for first element less
// than n, return its index
while (hi >= lo) {
int mid ... |
public double getMergeShardsChance()
{
return readRepairChance;
}
| public double getMergeShardsChance()
{
return mergeShardsChance;
}
|
public Node build(Random rng, Data data) {
for (int index = 0; index < data.size(); index++) {
assertTrue(expected.contains(data.get(index)));
}
return new Leaf(-1);
}
| public Node build(Random rng, Data data) {
for (int index = 0; index < data.size(); index++) {
assertTrue(expected.contains(data.get(index)));
}
return new Leaf(Double.NaN);
}
|
public Node build(Random rng, Data data) {
if (selected == null) {
selected = new boolean[data.getDataset().nbAttributes()];
selected[data.getDataset().getLabelId()] = true; // never select the label
}
if (m == 0) {
// set default m
double e = data.getDataset().nbAttributes() - 1;
... | public Node build(Random rng, Data data) {
if (selected == null) {
selected = new boolean[data.getDataset().nbAttributes()];
selected[data.getDataset().getLabelId()] = true; // never select the label
}
if (m == 0) {
// set default m
double e = data.getDataset().nbAttributes() - 1;
... |
protected void init(IndexSchema schema, Map<String, String> args) {
super.init(schema, args);
if (this.isMultiValued()) {
throw new SolrException(SolrException.ErrorCode.SERVER_ERROR,
"CurrencyField types can not be multiValued: " +
this.typ... | protected void init(IndexSchema schema, Map<String, String> args) {
super.init(schema, args);
if (this.isMultiValued()) {
throw new SolrException(SolrException.ErrorCode.SERVER_ERROR,
"CurrencyField types can not be multiValued: " +
this.typ... |
public void testServerStartup()
throws Exception
{
String myName = toString();
String serverOutput = getServerOutput();
boolean serverCameUp = serverCameUp();
boolean outputOK = ( serverOutput.indexOf( _outcome.expectedServerOutput() ) >= 0 );
... | public void testServerStartup()
throws Exception
{
String myName = toString();
String serverOutput = getServerOutput();
boolean serverCameUp = serverCameUp();
boolean outputOK = ( serverOutput.indexOf( _outcome.expectedServerOutput() ) >= 0 );
... |
public void update(SolrZooKeeper keeper) {
// if keeper does not replace oldKeeper we must be sure to close it
synchronized (connectionUpdateLock) {
try {
waitForConnected(SolrZkClient.DEFAULT_CLIENT_CONNECT_TIMEOUT);
... | public void update(SolrZooKeeper keeper) {
// if keeper does not replace oldKeeper we must be sure to close it
synchronized (connectionUpdateLock) {
try {
waitForConnected(Long.MAX_VALUE);
} catch (Exception e1) {
... |
public synchronized void response(Message response)
{
if (repairInvoked)
return;
try
{
byte[] body = response.getMessageBody();
ByteArrayInputStream bufIn = new ByteArrayInputStream(body);
ReadResponse result = Read... | public synchronized void response(Message response)
{
if (repairInvoked)
return;
try
{
byte[] body = response.getMessageBody();
ByteArrayInputStream bufIn = new ByteArrayInputStream(body);
ReadResponse result = Read... |
public void add(CharSequence key, CharSequence cmd) {
if (key == null || cmd == null) {
return;
}
if (cmd.length() == 0) {
return;
}
int id_cmd = cmds.indexOf(cmd);
if (id_cmd == -1) {
id_cmd = cmds.size();
cmds.add(cmd);
}
int node = root;
Row r = getR... | public void store(DataOutput os) throws IOException {
os.writeBoolean(forward);
os.writeInt(root);
os.writeInt(cmds.size());
for (CharSequence cmd : cmds)
os.writeUTF(cmd.toString());
os.writeInt(rows.size());
for (Row row : rows)
row.store(os);
}
/**
* Add the given... |
private void describeKeySpace(String keySpaceName, KsDef metadata) throws TException
{
NodeProbe probe = sessionState.getNodeProbe();
// getting compaction manager MBean to displaying index building information
CompactionManagerMBean compactionManagerMBean = (probe == null) ? null : pro... | private void describeKeySpace(String keySpaceName, KsDef metadata) throws TException
{
NodeProbe probe = sessionState.getNodeProbe();
// getting compaction manager MBean to displaying index building information
CompactionManagerMBean compactionManagerMBean = (probe == null) ? null : pro... |
public static void fixContextClassloader(String cls, String method, Class<?> clsArg, ClassLoader bundleLoader) {
if (!(bundleLoader instanceof BundleReference)) {
Activator.activator.log(LogService.LOG_WARNING, "Classloader of consuming bundle doesn't implement BundleReference: " + bundleLoader)... | public static void fixContextClassloader(String cls, String method, Class<?> clsArg, ClassLoader bundleLoader) {
if (!(bundleLoader instanceof BundleReference)) {
Activator.activator.log(LogService.LOG_WARNING, "Classloader of consuming bundle doesn't implement BundleReference: " + bundleLoader)... |
public void run()
{
while (true)
{
try
{
selector.select(100);
doProcess();
synchronized(gate) {}
}
catch (IOException e)
{
throw new RuntimeException(e);
}
... | public void run()
{
while (true)
{
try
{
selector.select(1);
doProcess();
synchronized(gate) {}
}
catch (IOException e)
{
throw new RuntimeException(e);
}
... |
public static Message makeBootstrapInitiateMessage(BootstrapInitiateMessage biMessage) throws IOException
{
ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream( bos );
BootstrapInitiateMessage.serializer().serialize(biMessage, dos);
... | public static Message makeBootstrapInitiateMessage(BootstrapInitiateMessage biMessage) throws IOException
{
ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream( bos );
BootstrapInitiateMessage.serializer().serialize(biMessage, dos);
... |
public void doVerb(Message message)
{
logger_.debug("Received a BootstrapMetadataMessage from " + message.getFrom());
byte[] body = (byte[])message.getMessageBody()[0];
DataInputBuffer bufIn = new DataInputBuffer();
bufIn.reset(body, body.length);
try
{
... | public void doVerb(Message message)
{
logger_.debug("Received a BootstrapMetadataMessage from " + message.getFrom());
byte[] body = message.getMessageBody();
DataInputBuffer bufIn = new DataInputBuffer();
bufIn.reset(body, body.length);
try
{
Bootstrap... |
protected static Message makeBootstrapMetadataMessage(BootstrapMetadataMessage bsMetadataMessage) throws IOException
{
ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream( bos );
BootstrapMetadataMessage.serializer().serialize(bsMetadataMe... | protected static Message makeBootstrapMetadataMessage(BootstrapMetadataMessage bsMetadataMessage) throws IOException
{
ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream( bos );
BootstrapMetadataMessage.serializer().serialize(bsMetadataMe... |
public static Message makeReadResponseMessage(ReadResponse readResponse) throws IOException
{
ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream( bos );
ReadResponse.serializer().serialize(readResponse, dos);
Message message = new Messa... | public static Message makeReadResponseMessage(ReadResponse readResponse) throws IOException
{
ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream( bos );
ReadResponse.serializer().serialize(readResponse, dos);
Message message = new Messa... |
public void doVerb(Message message)
{
byte[] body = (byte[])message.getMessageBody()[0];
DataInputBuffer buffer = new DataInputBuffer();
buffer.reset(body, body.length);
try
{
RowMutationMessage rmMsg = RowMutationMessage.serializer(... | public void doVerb(Message message)
{
byte[] body = message.getMessageBody();
DataInputBuffer buffer = new DataInputBuffer();
buffer.reset(body, body.length);
try
{
RowMutationMessage rmMsg = RowMutationMessage.serializer().deseriali... |
public void doVerb(Message message)
{
byte[] bytes = (byte[]) message.getMessageBody()[0];
/* Obtain a Row Mutation Context from TLS */
| public void doVerb(Message message)
{
byte[] bytes = message.getMessageBody();
/* Obtain a Row Mutation Context from TLS */
|
public static Message makeTouchMessage(TouchMessage touchMessage) throws IOException
{
ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream( bos );
TouchMessage.serializer().serialize(touchMessage, dos);
Message message = new Message(S... | public static Message makeTouchMessage(TouchMessage touchMessage) throws IOException
{
ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream( bos );
TouchMessage.serializer().serialize(touchMessage, dos);
Message message = new Message(S... |
public static RangeCommand read(Message message) throws IOException
{
byte[] bytes = (byte[]) message.getMessageBody()[0];
DataInputBuffer dib = new DataInputBuffer();
dib.reset(bytes, bytes.length);
return serializer.deserialize(new DataInputStream(dib));
}
| public static RangeCommand read(Message message) throws IOException
{
byte[] bytes = message.getMessageBody();
DataInputBuffer dib = new DataInputBuffer();
dib.reset(bytes, bytes.length);
return serializer.deserialize(new DataInputStream(dib));
}
|
public void doVerb(Message message)
{
byte[] body = (byte[])message.getMessageBody()[0];
/* Obtain a Read Context from TLS */
| public void doVerb(Message message)
{
byte[] body = message.getMessageBody();
/* Obtain a Read Context from TLS */
|
public static Message getCalloutDeployMessage(CalloutDeployMessage cdMessage) throws IOException
{
ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(bos);
serializer_.serialize(cdMessage, dos);
Message message = new Message(Stora... | public static Message getCalloutDeployMessage(CalloutDeployMessage cdMessage) throws IOException
{
ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(bos);
serializer_.serialize(cdMessage, dos);
Message message = new Message(Stora... |
public void doVerb(Message message)
{
byte[] bytes = (byte[])message.getMessageBody()[0];
/* 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 doVerb(Message message)
{
byte[] body = (byte[])message.getMessageBody()[0];
try
{
DataInputBuffer bufIn = new DataInputBuffer();
bufIn.reset(body, body.length);
/* Deserialize to get the token for this endpoint. */
Mem... | public void doVerb(Message message)
{
byte[] body = message.getMessageBody();
try
{
DataInputBuffer bufIn = new DataInputBuffer();
bufIn.reset(body, body.length);
/* Deserialize to get the token for this endpoint. */
MembershipClea... |
public static void main(String[] args) throws Throwable
{
if ( args.length != 3 )
{
System.out.println("Usage : java com.facebook.infrastructure.tools.MembershipCleaner " +
"<ip:port to send the message> " +
"<node which needs to be removed> " ... | public static void main(String[] args) throws Throwable
{
if ( args.length != 3 )
{
System.out.println("Usage : java com.facebook.infrastructure.tools.MembershipCleaner " +
"<ip:port to send the message> " +
"<node which needs to be removed> " ... |
public static void main(String[] args) throws Throwable
{
if ( args.length != 3 )
{
System.out.println("Usage : java com.facebook.infrastructure.tools.TokenUpdater <ip:port> <token> <file containing node token info>");
System.exit(1);
}
String ipP... | public static void main(String[] args) throws Throwable
{
if ( args.length != 3 )
{
System.out.println("Usage : java com.facebook.infrastructure.tools.TokenUpdater <ip:port> <token> <file containing node token info>");
System.exit(1);
}
String ipP... |
public List<String> get_key_range(String tablename, String startWith, String stopAt, int maxResults) throws InvalidRequestException
{
logger_.debug("get_range");
if (!(StorageService.getPartitioner() instanceof OrderPreservingPartitioner))
{
throw new InvalidRequestException... | public List<String> get_key_range(String tablename, String startWith, String stopAt, int maxResults) throws InvalidRequestException
{
logger_.debug("get_range");
if (!(StorageService.getPartitioner() instanceof OrderPreservingPartitioner))
{
throw new InvalidRequestException... |
public void doVerb(Message message)
{
byte[] body = (byte[])message.getMessageBody()[0];
DataInputBuffer bufIn = new DataInputBuffer();
bufIn.reset(body, body.length);
try
{
StreamContextManager.StreamStatusMessage streamStatus... | public void doVerb(Message message)
{
byte[] body = message.getMessageBody();
DataInputBuffer bufIn = new DataInputBuffer();
bufIn.reset(body, body.length);
try
{
StreamContextManager.StreamStatusMessage streamStatusMessage = S... |
private void handleDigestResponses()
{
DataInputBuffer bufIn = new DataInputBuffer();
logger_.debug("Handle Digest reponses");
for( Message response : responses_ )
{
byte[] body = (byte[])response.getMessageBody()[0];
bufIn.reset(body, body.length);
try
... | private void handleDigestResponses()
{
DataInputBuffer bufIn = new DataInputBuffer();
logger_.debug("Handle Digest reponses");
for( Message response : responses_ )
{
byte[] body = response.getMessageBody();
bufIn.reset(body, body.length);
try
{
... |
public void doVerb(Message message)
{
byte[] body = (byte[])message.getMessageBody()[0];
Token token = StorageService.getPartitioner().getTokenFactory().fromByteArray(body);
try
{
logger_.info("Updating the token to [" + token + "]");
StorageService.instance().upda... | public void doVerb(Message message)
{
byte[] body = message.getMessageBody();
Token token = StorageService.getPartitioner().getTokenFactory().fromByteArray(body);
try
{
logger_.info("Updating the token to [" + token + "]");
StorageService.instance().updateToken(tok... |
public void schedule(EndPoint target, RowMutationMessage rowMutationMessage)
{
try
{
Message message = RowMutationMessage.makeRowMutationMessage(rowMutationMessage, StorageService.readRepairVerbHandler_);
String key = target + ":" + message.getMessageId();
readRepairTable_.put(... | public void schedule(EndPoint target, RowMutationMessage rowMutationMessage)
{
try
{
Message message = rowMutationMessage.makeRowMutationMessage(StorageService.readRepairVerbHandler_);
String key = target + ":" + message.getMessageId();
readRepairTable_.put(key, message);
... |
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 static Test suite() {
TestSuite suite = new TestSuite("lang");
// DERBY-1315 and DERBY-1735 need to be addressed
// before re-enabling this test as it's memory use is
// different on different vms leading to failures in
// the nightly runs.
// suite.addTest(la... | public static Test suite() throws Exception {
TestSuite suite = new TestSuite("lang");
// DERBY-1315 and DERBY-1735 need to be addressed
// before re-enabling this test as it's memory use is
// different on different vms leading to failures in
// the nightly runs.
//... |
public DocIdSet getDocIdSet(AtomicReaderContext context, Bits acceptDocs) throws IOException {
AtomicReader reader = context.reader();
FixedBitSet result = new FixedBitSet(reader.maxDoc());
Fields fields = reader.fields();
if (fields == null) {
return result;
}
BytesRef br = new BytesR... | public DocIdSet getDocIdSet(AtomicReaderContext context, Bits acceptDocs) throws IOException {
AtomicReader reader = context.reader();
FixedBitSet result = new FixedBitSet(reader.maxDoc());
Fields fields = reader.fields();
if (fields == null) {
return result;
}
BytesRef br = new BytesR... |
protected Map<CategoryPath, Integer> facetCountsTruth() throws IOException {
FacetIndexingParams iParams = getFacetIndexingParams(Integer.MAX_VALUE);
String delim = String.valueOf(iParams.getFacetDelimChar());
Map<CategoryPath, Integer> res = new HashMap<CategoryPath, Integer>();
HashSet<Term> handled... | protected Map<CategoryPath, Integer> facetCountsTruth() throws IOException {
FacetIndexingParams iParams = getFacetIndexingParams(Integer.MAX_VALUE);
String delim = String.valueOf(iParams.getFacetDelimChar());
Map<CategoryPath, Integer> res = new HashMap<CategoryPath, Integer>();
HashSet<Term> handled... |
public int getOrdinal(CategoryPath categoryPath) throws IOException {
ensureOpen();
if (categoryPath.length()==0) {
return ROOT_ORDINAL;
}
String path = categoryPath.toString(delimiter);
// First try to find the answer in the LRU cache:
synchronized(ordinalCache) {
Integer res = o... | public int getOrdinal(CategoryPath categoryPath) throws IOException {
ensureOpen();
if (categoryPath.length()==0) {
return ROOT_ORDINAL;
}
String path = categoryPath.toString(delimiter);
// First try to find the answer in the LRU cache:
synchronized(ordinalCache) {
Integer res = o... |
private void recount(FacetResultNode fresNode, ScoredDocIDs docIds)
throws IOException {
// TODO (Facet): change from void to return the new, smaller docSet, and use
// that for the children, as this will make their intersection ops faster.
// can do this only when the new set is "sufficiently" smal... | private void recount(FacetResultNode fresNode, ScoredDocIDs docIds)
throws IOException {
// TODO (Facet): change from void to return the new, smaller docSet, and use
// that for the children, as this will make their intersection ops faster.
// can do this only when the new set is "sufficiently" smal... |
public DocIdSet getDocIdSet(AtomicReaderContext context, Bits acceptDocs) throws IOException {
final AtomicReader reader = context.reader();
final Fields fields = reader.fields();
if (fields == null) {
// reader has no fields
return DocIdSet.EMPTY_DOCIDSET;
}
final Terms terms = field... | public DocIdSet getDocIdSet(AtomicReaderContext context, Bits acceptDocs) throws IOException {
final AtomicReader reader = context.reader();
final Fields fields = reader.fields();
if (fields == null) {
// reader has no fields
return DocIdSet.EMPTY_DOCIDSET;
}
final Terms terms = field... |
public void testCodec() throws Exception {
Directory dir = new AppendingRAMDirectory(random(), new RAMDirectory());
IndexWriterConfig cfg = new IndexWriterConfig(Version.LUCENE_40, new MockAnalyzer(random()));
cfg.setCodec(new AppendingCodec());
((TieredMergePolicy)cfg.getMergePolicy()).setUseCom... | public void testCodec() throws Exception {
Directory dir = new AppendingRAMDirectory(random(), new RAMDirectory());
IndexWriterConfig cfg = new IndexWriterConfig(Version.LUCENE_40, new MockAnalyzer(random()));
cfg.setCodec(new AppendingCodec());
((TieredMergePolicy)cfg.getMergePolicy()).setUseCom... |
public void testKnownSetOfDocuments() throws IOException {
String test1 = "eating chocolate in a computer lab"; //6 terms
String test2 = "computer in a computer lab"; //5 terms
String test3 = "a chocolate lab grows old"; //5 terms
String test4 = "eating chocolate with a chocolate lab in an old chocola... | public void testKnownSetOfDocuments() throws IOException {
String test1 = "eating chocolate in a computer lab"; //6 terms
String test2 = "computer in a computer lab"; //5 terms
String test3 = "a chocolate lab grows old"; //5 terms
String test4 = "eating chocolate with a chocolate lab in an old chocola... |
public void testCloseWithThreads() throws Exception {
int NUM_THREADS = 3;
int numIterations = TEST_NIGHTLY ? 7 : 3;
for(int iter=0;iter<numIterations;iter++) {
Directory dir = newDirectory();
IndexWriter writer = new IndexWriter(
dir,
newIndexWriterConfig(TEST_VERSION_CUR... | public void testCloseWithThreads() throws Exception {
int NUM_THREADS = 3;
int numIterations = TEST_NIGHTLY ? 7 : 3;
for(int iter=0;iter<numIterations;iter++) {
Directory dir = newDirectory();
IndexWriter writer = new IndexWriter(
dir,
newIndexWriterConfig(TEST_VERSION_CUR... |
private void verifyTermDocs(Directory dir, Term term, int numDocs)
throws IOException {
IndexReader reader = DirectoryReader.open(dir);
DocsEnum docsEnum = _TestUtil.docs(random(), reader, term.field, term.bytes, null, null, false);
int count = 0;
while (docsEnum.nextDoc() != DocIdSetIterator.NO... | private void verifyTermDocs(Directory dir, Term term, int numDocs)
throws IOException {
IndexReader reader = DirectoryReader.open(dir);
DocsEnum docsEnum = _TestUtil.docs(random(), reader, term.field, term.bytes, null, null, 0);
int count = 0;
while (docsEnum.nextDoc() != DocIdSetIterator.NO_MOR... |
public void testDocsEnum() throws IOException {
TermVectorsReader reader = Codec.getDefault().termVectorsFormat().vectorsReader(dir, seg.info, fieldInfos, newIOContext(random()));
for (int j = 0; j < 5; j++) {
Terms vector = reader.get(j).terms(testFields[0]);
assertNotNull(vector);
assertEq... | public void testDocsEnum() throws IOException {
TermVectorsReader reader = Codec.getDefault().termVectorsFormat().vectorsReader(dir, seg.info, fieldInfos, newIOContext(random()));
for (int j = 0; j < 5; j++) {
Terms vector = reader.get(j).terms(testFields[0]);
assertNotNull(vector);
assertEq... |
public void reset() throws IOException {
super.reset();
this.count = 0;
}
});
}
});
conf.setMaxBufferedDocs(Math.max(3, conf.getMaxBufferedDocs()));
IndexWriter writer = new IndexWriter(dir, conf);
Document doc = new Document();
String con... | public void reset() throws IOException {
super.reset();
this.count = 0;
}
});
}
});
conf.setMaxBufferedDocs(Math.max(3, conf.getMaxBufferedDocs()));
IndexWriter writer = new IndexWriter(dir, conf);
Document doc = new Document();
String con... |
private void checkTerms(Terms terms, Bits liveDocs, String... termsList) throws IOException {
assertNotNull(terms);
final TermsEnum te = terms.iterator(null);
for (String t : termsList) {
BytesRef b = te.next();
assertNotNull(b);
assertEquals(t, b.utf8ToString());
DocsEnum td ... | private void checkTerms(Terms terms, Bits liveDocs, String... termsList) throws IOException {
assertNotNull(terms);
final TermsEnum te = terms.iterator(null);
for (String t : termsList) {
BytesRef b = te.next();
assertNotNull(b);
assertEquals(t, b.utf8ToString());
DocsEnum td ... |
public int doTest(int iter, int ndocs, int maxTF, float percentDocs) throws IOException {
Directory dir = newDirectory();
long start = System.currentTimeMillis();
addDocs(random(), dir, ndocs, "foo", "val", maxTF, percentDocs);
long end = System.currentTimeMillis();
if (VERBOSE) System.out.printl... | public int doTest(int iter, int ndocs, int maxTF, float percentDocs) throws IOException {
Directory dir = newDirectory();
long start = System.currentTimeMillis();
addDocs(random(), dir, ndocs, "foo", "val", maxTF, percentDocs);
long end = System.currentTimeMillis();
if (VERBOSE) System.out.printl... |
private void verifyCount(IndexReader ir) throws Exception {
Fields fields = MultiFields.getFields(ir);
if (fields == null) {
return;
}
FieldsEnum e = fields.iterator();
String field;
while ((field = e.next()) != null) {
Terms terms = fields.terms(field);
if (terms == null) {
... | private void verifyCount(IndexReader ir) throws Exception {
Fields fields = MultiFields.getFields(ir);
if (fields == null) {
return;
}
FieldsEnum e = fields.iterator();
String field;
while ((field = e.next()) != null) {
Terms terms = fields.terms(field);
if (terms == null) {
... |
public void testBasic() throws Exception {
Directory dir = newDirectory();
RandomIndexWriter w = new RandomIndexWriter(random(), dir);
Document doc = new Document();
FieldType ft = new FieldType(TextField.TYPE_NOT_STORED);
ft.setIndexOptions(IndexOptions.DOCS_AND_FREQS);
Field f = newField(... | public void testBasic() throws Exception {
Directory dir = newDirectory();
RandomIndexWriter w = new RandomIndexWriter(random(), dir);
Document doc = new Document();
FieldType ft = new FieldType(TextField.TYPE_NOT_STORED);
ft.setIndexOptions(IndexOptions.DOCS_AND_FREQS);
Field f = newField(... |
public void testMerge() throws IOException {
final Codec codec = Codec.getDefault();
final SegmentInfo si = new SegmentInfo(mergedDir, Constants.LUCENE_MAIN_VERSION, mergedSegment, -1, false, codec, null, null);
SegmentMerger merger = new SegmentMerger(si, InfoStream.getDefault(), mergedDir, IndexWriterC... | public void testMerge() throws IOException {
final Codec codec = Codec.getDefault();
final SegmentInfo si = new SegmentInfo(mergedDir, Constants.LUCENE_MAIN_VERSION, mergedSegment, -1, false, codec, null, null);
SegmentMerger merger = new SegmentMerger(si, InfoStream.getDefault(), mergedDir, IndexWriterC... |
public int docId(AtomicReader reader, Term term) throws IOException {
int docFreq = reader.docFreq(term);
assertEquals(1, docFreq);
DocsEnum termDocsEnum = reader.termDocsEnum(null, term.field, term.bytes, false);
int nextDoc = termDocsEnum.nextDoc();
assertEquals(DocIdSetIterator.NO_MORE_DOCS, te... | public int docId(AtomicReader reader, Term term) throws IOException {
int docFreq = reader.docFreq(term);
assertEquals(1, docFreq);
DocsEnum termDocsEnum = reader.termDocsEnum(null, term.field, term.bytes, 0);
int nextDoc = termDocsEnum.nextDoc();
assertEquals(DocIdSetIterator.NO_MORE_DOCS, termDo... |
private void verifyEnum(ThreadState threadState,
String field,
BytesRef term,
TermsEnum termsEnum,
// Maximum options (docs/freqs/positions/offsets) to test:
IndexOptions maxIndexOptions,... | private void verifyEnum(ThreadState threadState,
String field,
BytesRef term,
TermsEnum termsEnum,
// Maximum options (docs/freqs/positions/offsets) to test:
IndexOptions maxIndexOptions,... |
public int[] toDocsArray(Term term, Bits bits, IndexReader reader)
throws IOException {
Fields fields = MultiFields.getFields(reader);
Terms cterms = fields.terms(term.field);
TermsEnum ctermsEnum = cterms.iterator(null);
if (ctermsEnum.seekExact(new BytesRef(term.text()), false)) {
DocsEn... | public int[] toDocsArray(Term term, Bits bits, IndexReader reader)
throws IOException {
Fields fields = MultiFields.getFields(reader);
Terms cterms = fields.terms(term.field);
TermsEnum ctermsEnum = cterms.iterator(null);
if (ctermsEnum.seekExact(new BytesRef(term.text()), false)) {
DocsEn... |
public synchronized ShapeFieldCache<T> getCache(AtomicReader reader) throws IOException {
ShapeFieldCache<T> idx = sidx.get(reader);
if (idx != null) {
return idx;
}
long startTime = System.currentTimeMillis();
log.fine("Building Cache [" + reader.maxDoc() + "]");
idx = new ShapeFieldCa... | public synchronized ShapeFieldCache<T> getCache(AtomicReader reader) throws IOException {
ShapeFieldCache<T> idx = sidx.get(reader);
if (idx != null) {
return idx;
}
long startTime = System.currentTimeMillis();
log.fine("Building Cache [" + reader.maxDoc() + "]");
idx = new ShapeFieldCa... |
private FixedBitSet createExpectedResult(String queryValue, boolean from, IndexReader topLevelReader, IndexIterationContext context) throws IOException {
final Map<String, List<RandomDoc>> randomValueDocs;
final Map<String, List<RandomDoc>> linkValueDocuments;
if (from) {
randomValueDocs = context.r... | private FixedBitSet createExpectedResult(String queryValue, boolean from, IndexReader topLevelReader, IndexIterationContext context) throws IOException {
final Map<String, List<RandomDoc>> randomValueDocs;
final Map<String, List<RandomDoc>> linkValueDocuments;
if (from) {
randomValueDocs = context.r... |
protected int getFirstMatch(IndexReader r, Term t) throws IOException {
Fields fields = MultiFields.getFields(r);
if (fields == null) return -1;
Terms terms = fields.terms(t.field());
if (terms == null) return -1;
BytesRef termBytes = t.bytes();
final TermsEnum termsEnum = terms.iterator(null)... | protected int getFirstMatch(IndexReader r, Term t) throws IOException {
Fields fields = MultiFields.getFields(r);
if (fields == null) return -1;
Terms terms = fields.terms(t.field());
if (terms == null) return -1;
BytesRef termBytes = t.bytes();
final TermsEnum termsEnum = terms.iterator(null)... |
private static float[] getFloats(FileFloatSource ffs, IndexReader reader) {
float[] vals = new float[reader.maxDoc()];
if (ffs.defVal != 0) {
Arrays.fill(vals, ffs.defVal);
}
InputStream is;
String fname = "external_" + ffs.field.getName();
try {
is = VersionedFile.getLatestFile(ff... | private static float[] getFloats(FileFloatSource ffs, IndexReader reader) {
float[] vals = new float[reader.maxDoc()];
if (ffs.defVal != 0) {
Arrays.fill(vals, ffs.defVal);
}
InputStream is;
String fname = "external_" + ffs.field.getName();
try {
is = VersionedFile.getLatestFile(ff... |
private static Document getFirstLiveDoc(AtomicReader reader, String fieldName, Terms terms) throws IOException {
DocsEnum docsEnum = null;
TermsEnum termsEnum = terms.iterator(null);
BytesRef text;
// Deal with the chance that the first bunch of terms are in deleted documents. Is there a better way?
... | private static Document getFirstLiveDoc(AtomicReader reader, String fieldName, Terms terms) throws IOException {
DocsEnum docsEnum = null;
TermsEnum termsEnum = terms.iterator(null);
BytesRef text;
// Deal with the chance that the first bunch of terms are in deleted documents. Is there a better way?
... |
public NamedList<Integer> getFacetTermEnumCounts(SolrIndexSearcher searcher, DocSet docs, String field, int offset, int limit, int mincount, boolean missing, String sort, String prefix)
throws IOException {
/* :TODO: potential optimization...
* cache the Terms with the highest docFreq and try them first
... | public NamedList<Integer> getFacetTermEnumCounts(SolrIndexSearcher searcher, DocSet docs, String field, int offset, int limit, int mincount, boolean missing, String sort, String prefix)
throws IOException {
/* :TODO: potential optimization...
* cache the Terms with the highest docFreq and try them first
... |
protected void handleRequestSyncAction(SolrQueryRequest req,
SolrQueryResponse rsp) throws IOException {
final SolrParams params = req.getParams();
log.info("I have been requested to sync up my shard");
ZkController zkController = coreContainer.getZkController();
if (zkController == null) {
... | protected void handleRequestSyncAction(SolrQueryRequest req,
SolrQueryResponse rsp) throws IOException {
final SolrParams params = req.getParams();
log.info("I have been requested to sync up my shard");
ZkController zkController = coreContainer.getZkController();
if (zkController == null) {
... |
protected boolean isEquivalent(ValueNode o)
{
if (isSameNodeType(o))
{
BaseColumnNode other = (BaseColumnNode)o;
return other.tableName.equals(other.tableName)
&& other.columnName.equals(columnName);
}
return false;
}
| protected boolean isEquivalent(ValueNode o)
{
if (isSameNodeType(o))
{
BaseColumnNode other = (BaseColumnNode)o;
return other.tableName.equals(tableName)
&& other.columnName.equals(columnName);
}
return false;
}
|
public void testEmptyArraySort() {
List<Integer> list = Collections.emptyList();
CollectionUtil.quickSort(list);
CollectionUtil.mergeSort(list);
CollectionUtil.insertionSort(list);
CollectionUtil.quickSort(list, Collections.reverseOrder());
CollectionUtil.mergeSort(list, Collections.reverseOrd... | public void testEmptyArraySort() {
List<Integer> list = Arrays.asList(new Integer[0]);
CollectionUtil.quickSort(list);
CollectionUtil.mergeSort(list);
CollectionUtil.insertionSort(list);
CollectionUtil.quickSort(list, Collections.reverseOrder());
CollectionUtil.mergeSort(list, Collections.reve... |
public void test() {
//Positive test of FieldInfos
assertTrue(testDoc != null);
FieldInfos fieldInfos = new FieldInfos();
fieldInfos.add(testDoc);
//Since the complement is stored as well in the fields map
assertTrue(fieldInfos.size() == 7); //this is 7 b/c we are using the no-arg constructor
... | public void test() {
//Positive test of FieldInfos
assertTrue(testDoc != null);
FieldInfos fieldInfos = new FieldInfos();
fieldInfos.add(testDoc);
//Since the complement is stored as well in the fields map
assertTrue(fieldInfos.size() == 6); //this is 6 b/c we are using the no-arg constructor
... |
public void testVerB() throws IOException
{
SSTableReader reader = SSTableReader.open(getDescriptor("b"));
List<byte[]> keys = new ArrayList<byte[]>(TEST_DATA.keySet());
Collections.shuffle(keys);
BufferedRandomAccessFile file = new BufferedRandomAccessFile(reader.getFilename(),... | public void testVerB() throws IOException
{
SSTableReader reader = SSTableReader.open(getDescriptor("b"));
List<byte[]> keys = new ArrayList<byte[]>(TEST_DATA.keySet());
Collections.shuffle(keys);
BufferedRandomAccessFile file = new BufferedRandomAccessFile(reader.getFilename(),... |
public void onStatusChange(InetAddress host, PendingFile pendingFile, FileStatus streamStatus) throws IOException
{
if (FileStatus.Action.STREAM == streamStatus.getAction())
{
// file needs to be restreamed
logger.warn("Streaming of file " + pendingFile + " from " + host ... | public void onStatusChange(InetAddress host, PendingFile pendingFile, FileStatus streamStatus) throws IOException
{
if (FileStatus.Action.STREAM == streamStatus.getAction())
{
// file needs to be restreamed
logger.warn("Streaming of file " + pendingFile + " from " + host ... |
public static void transferSSTables(InetAddress target, List<SSTableReader> sstables, String table) throws IOException
{
PendingFile[] pendingFiles = new PendingFile[SSTable.FILES_ON_DISK * sstables.size()];
int i = 0;
for (SSTableReader sstable : sstables)
{
for (Str... | public static void transferSSTables(InetAddress target, List<SSTableReader> sstables, String table) throws IOException
{
PendingFile[] pendingFiles = new PendingFile[SSTable.FILES_ON_DISK * sstables.size()];
int i = 0;
for (SSTableReader sstable : sstables)
{
for (Str... |
private static String normalize( String p )
{
if( p != null && p.endsWith( "/" ) )
return p.substring( 0, p.length()-1 );
return p;
}
| private static String normalize( String p )
{
if( p != null && p.endsWith( "/" ) && p.length() > 1 )
return p.substring( 0, p.length()-1 );
return p;
}
|
public final Token next()
throws IOException {
if ((token = input.next()) == null) {
return null;
}
// Check the exclusiontable.
else if (exclusions != null && exclusions.contains(token.termText())) {
return token;
} else {
String s = stemmer.stem(token.termText());
/... | public final Token next()
throws IOException {
if ((token = input.next()) == null) {
return null;
}
// Check the exclusiontable.
else if (exclusions != null && exclusions.contains(token.termText())) {
return token;
} else {
String s = stemmer.stem(token.termText());
/... |
public void testEmbeddedCassandraService() throws UnsupportedEncodingException, InvalidRequestException,
UnavailableException, TimedOutException, TException, NotFoundException
{
Cassandra.Client client = getClient();
String key_user_id = "1";
long timestamp = System.current... | public void testEmbeddedCassandraService() throws UnsupportedEncodingException, InvalidRequestException,
UnavailableException, TimedOutException, TException, NotFoundException
{
Cassandra.Client client = getClient();
byte[] key_user_id = "1".getBytes();
long timestamp = Sys... |
public static final String VERSION = "3.0.0";
} | public static final String VERSION = "4.0.0";
} |
public Tuple getNext() throws IOException
{
try
{
// load the next pair
if (!reader.nextKeyValue())
return null;
String key = (String)reader.getCurrentKey();
SortedMap<byte[],IColumn> cf = (SortedMap<byte[],IColumn>)reader.getCurren... | public Tuple getNext() throws IOException
{
try
{
// load the next pair
if (!reader.nextKeyValue())
return null;
byte[] key = (byte[])reader.getCurrentKey();
SortedMap<byte[],IColumn> cf = (SortedMap<byte[],IColumn>)reader.getCurren... |
public static final String VERSION = "11.0.0";
} | public static final String VERSION = "11.1.0";
} |
private String getSourceUrl() {
return "http" + (isSSLMode() ? "s" : "") +"://127.0.0.1:" + jetty.getLocalPort() + "/solr";
}
| private String getSourceUrl() {
return buildUrl(jetty.getLocalPort(), "/solr");
}
|
protected void createServers(int numShards) throws Exception {
// give everyone there own solrhome
File controlHome = new File(new File(getSolrHome()).getParentFile(), "control" + homeCount.incrementAndGet());
FileUtils.copyDirectory(new File(getSolrHome()), controlHome);
setupJettySolrHome(controlHom... | protected void createServers(int numShards) throws Exception {
// give everyone there own solrhome
File controlHome = new File(new File(getSolrHome()).getParentFile(), "control" + homeCount.incrementAndGet());
FileUtils.copyDirectory(new File(getSolrHome()), controlHome);
setupJettySolrHome(controlHom... |
private void getServers() throws Exception {
jetty.start();
url = "http" + (isSSLMode() ? "s" : "") + "://127.0.0.1:" + jetty.getLocalPort() + "/solr/";
// Mostly to keep annoying logging messages from being sent out all the time.
for (int idx = 0; idx < indexingThreads; ++idx) {
HttpSolrServe... | private void getServers() throws Exception {
jetty.start();
url = buildUrl(jetty.getLocalPort(), "/solr/");
// Mostly to keep annoying logging messages from being sent out all the time.
for (int idx = 0; idx < indexingThreads; ++idx) {
HttpSolrServer server = new HttpSolrServer(url);
ser... |
public void close() {
try {
synchronized(searcherLock) {
// it's possible for someone to get a reference via the _searchers queue
// and increment the refcount while RefCounted.close() is being called.
// we check the refcount again to see if this has happened... | public void close() {
try {
synchronized(searcherLock) {
// it's possible for someone to get a reference via the _searchers queue
// and increment the refcount while RefCounted.close() is being called.
// we check the refcount again to see if this has happened... |
protected void afterExecute(Runnable r, Throwable t)
{
super.afterExecute(r, t);
cassandraServer.logout();
}
};
serverEngine = new CustomTThreadPoolServer(new TProcessorFactory(processor),
tS... | protected void afterExecute(Runnable r, Throwable t)
{
super.afterExecute(r, t);
cassandraServer.clientState.logout();
}
};
serverEngine = new CustomTThreadPoolServer(new TProcessorFactory(processor),
... |
public String toString()
{
return "#<User %s groups=%s>".format(username, groups);
}
| public String toString()
{
return String.format("#<User %s groups=%s>", username, groups);
}
|
private void computeStd(int cI) {
List<VectorWritable> repPts = representativePoints.get(cI);
GaussianAccumulator accumulator = new RunningSumsGaussianAccumulator();
for (VectorWritable vw : repPts) {
accumulator.observe(vw.get(), 1);
}
accumulator.compute();
double d = accumulator.getAv... | private void computeStd(int cI) {
List<VectorWritable> repPts = representativePoints.get(cI);
GaussianAccumulator accumulator = new RunningSumsGaussianAccumulator();
for (VectorWritable vw : repPts) {
accumulator.observe(vw.get());
}
accumulator.compute();
double d = accumulator.getAvera... |
public void testQPA() throws Exception {
assertQueryEquals("term term^3.0 term", qpAnalyzer, "term term^3.0 term");
assertQueryEquals("term stop^3.0 term", qpAnalyzer, "term term");
assertQueryEquals("term term term", qpAnalyzer, "term term term");
assertQueryEquals("term +stop term", qpAnalyzer, "te... | public void testQPA() throws Exception {
assertQueryEquals("term term^3.0 term", qpAnalyzer, "term term^3.0 term");
assertQueryEquals("term stop^3.0 term", qpAnalyzer, "term term");
assertQueryEquals("term term term", qpAnalyzer, "term term term");
assertQueryEquals("term +stop term", qpAnalyzer, "te... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.