buggy_function
stringlengths
1
391k
fixed_function
stringlengths
0
392k
public void testBufferOverflow() throws Exception { StringBuilder testBuilder = new StringBuilder(HTMLStripCharFilter.DEFAULT_READ_AHEAD + 50); testBuilder.append("ah<?> "); appendChars(testBuilder, HTMLStripCharFilter.DEFAULT_READ_AHEAD + 500); processBuffer(testBuilder.toString(), "Failed on pseudo ...
public void testBufferOverflow() throws Exception { StringBuilder testBuilder = new StringBuilder(HTMLStripCharFilter.DEFAULT_READ_AHEAD + 50); testBuilder.append("ah<?> ??????"); appendChars(testBuilder, HTMLStripCharFilter.DEFAULT_READ_AHEAD + 500); processBuffer(testBuilder.toString(), "Failed on p...
public void testMissingSubcolumn() { SuperColumn sc = new SuperColumn("sc1".getBytes(), LongType.instance, ClockType.Timestamp, new TimestampReconciler()); sc.addColumn(new Column(getBytes(1), "value".getBytes(), new TimestampClock(1))); assertNotNull(sc.getSubColumn(getBytes(1))); assertNull(sc...
public void testMissingSubcolumn() { SuperColumn sc = new SuperColumn("sc1".getBytes(), LongType.instance, ClockType.Timestamp, TimestampReconciler.instance); sc.addColumn(new Column(getBytes(1), "value".getBytes(), new TimestampClock(1))); assertNotNull(sc.getSubColumn(getBytes(1))); assertNull...
private ColumnFamilyStore(String table, String columnFamilyName, IPartitioner partitioner, int generation, CFMetaData metadata) { assert metadata != null : "null metadata for " + table + ":" + columnFamilyName; table_ = table; columnFamily_ = columnFamilyName; this.metadata = me...
private ColumnFamilyStore(String table, String columnFamilyName, IPartitioner partitioner, int generation, CFMetaData metadata) { assert metadata != null : "null metadata for " + table + ":" + columnFamilyName; table_ = table; columnFamily_ = columnFamilyName; this.metadata = me...
private CFMetaData convertToCFMetaData(CfDef cf_def) throws InvalidRequestException, ConfigurationException { ColumnFamilyType cfType = ColumnFamilyType.create(cf_def.column_type); if (cfType == null) { throw new InvalidRequestException("Invalid column type " + cf_def.column_ty...
private CFMetaData convertToCFMetaData(CfDef cf_def) throws InvalidRequestException, ConfigurationException { ColumnFamilyType cfType = ColumnFamilyType.create(cf_def.column_type); if (cfType == null) { throw new InvalidRequestException("Invalid column type " + cf_def.column_ty...
public List<ColumnOrSuperColumn> get_slice(String keyspace, String key, ColumnParent column_parent, SlicePredicate predicate, int consistency_level) throws InvalidRequestException, NotFoundException, UnavailableException { if (logger.isDebugEnabled()) logger.debug("get_slice"); r...
public List<ColumnOrSuperColumn> get_slice(String keyspace, String key, ColumnParent column_parent, SlicePredicate predicate, int consistency_level) throws InvalidRequestException, UnavailableException { if (logger.isDebugEnabled()) logger.debug("get_slice"); return multigetSlice...
public void clear() { Arrays.fill(this.state, 0, state.length - 1, FREE); distinct = 0; freeEntries = table.length; // delta trimToSize(); }
public void clear() { Arrays.fill(this.state, FREE); distinct = 0; freeEntries = table.length; // delta trimToSize(); }
public BigDecimal getBigDecimal() { if (isNull()) return null; return new BigDecimal(value); }
public BigDecimal getBigDecimal() { if (isNull()) return null; return new BigDecimal(Double.toString(value)); }
public BigDecimal getBigDecimal() { if (isNull()) return null; return new BigDecimal(value); }
public BigDecimal getBigDecimal() { if (isNull()) return null; return new BigDecimal(Float.toString(value)); }
public BigDecimal getBigDecimal() throws StandardException { if (! isNull()) { if (value instanceof BigDecimal) return ((BigDecimal)value); if (value instanceof Number) return new BigDecimal(((Number) value).doubleValue()); } return super.getBigDecimal(); }
public BigDecimal getBigDecimal() throws StandardException { if (! isNull()) { if (value instanceof BigDecimal) return ((BigDecimal)value); if (value instanceof Number) return new BigDecimal(Double.toString(((Number) value).doubleValue())); } return super.getBigDecimal(); }
public Import(String inputFileName, String columnDelimiter, String characterDelimiter, String codeset, int noOfColumnsExpected, String columnTypes, boolean lobsInExtFile, int importCounter ) throws SQLException { try{ this.inputFileNam...
public Import(String inputFileName, String columnDelimiter, String characterDelimiter, String codeset, int noOfColumnsExpected, String columnTypes, boolean lobsInExtFile, int importCounter ) throws SQLException { try{ this.inputFileNam...
private void fill() throws IOException { StringBuilder buffered = new StringBuilder(); char [] temp = new char [1024]; for (int cnt = in.read(temp); cnt > 0; cnt = in.read(temp)) { buffered.append(temp, 0, cnt); } transformedInput = new StringReader(processPattern(buffered).toString()); }
private void fill() throws IOException { StringBuilder buffered = new StringBuilder(); char [] temp = new char [1024]; for (int cnt = input.read(temp); cnt > 0; cnt = input.read(temp)) { buffered.append(temp, 0, cnt); } transformedInput = new StringReader(processPattern(buffered).toString())...
private void prepareXATransaction(Xid xid) throws DRDAProtocolException { XAResource xaResource = getXAResource(); int xaRetVal = xaResource.XA_OK; try { xaResource.prepare(xid); if (SanityManager.DEBUG) { connThread.trace("prepared xa transaction: xaRetVal=" + xaRetVal); } } catch (...
private void prepareXATransaction(Xid xid) throws DRDAProtocolException { XAResource xaResource = getXAResource(); int xaRetVal = xaResource.XA_OK; try { xaRetVal = xaResource.prepare(xid); if (SanityManager.DEBUG) { connThread.trace("prepared xa transaction: xaRetVal=" + xaRetVal); } ...
public int getTransactionTimeout() throws XAException { if (conn_.agent_.loggingEnabled()) { conn_.agent_.logWriter_.traceEntry(this, "getTransactionTimeout"); } exceptionsOnXA = null; if (conn_.isPhysicalConnClosed()) { connectionClosedFailure(); } ...
public int getTransactionTimeout() throws XAException { if (conn_.agent_.loggingEnabled()) { conn_.agent_.logWriter_.traceEntry(this, "getTransactionTimeout"); } exceptionsOnXA = null; if (conn_.isPhysicalConnClosed()) { connectionClosedFailure(); } ...
public static boolean getAttribute(Element element, String attributeName, boolean deflt) { String result = element.getAttribute(attributeName); if ((result == null) || ("".equals(result))) { return deflt; } return Boolean.getBoolean(result); }
public static boolean getAttribute(Element element, String attributeName, boolean deflt) { String result = element.getAttribute(attributeName); if ((result == null) || ("".equals(result))) { return deflt; } return Boolean.valueOf(result).booleanValue(); }
public void emitPoint(Vector point, OutputCollector<Text, Text> collector) throws IOException { collector.collect(new Text(formatCanopy(this)), new Text(point .asFormatString())); }
public void emitPoint(Vector point, OutputCollector<Text, Text> collector) throws IOException { collector.collect(new Text(this.getIdentifier()), new Text(point .asFormatString())); }
protected FromBaseTable getResultColumnList(ResultColumnList inputRcl) throws StandardException { /* Get a ResultColumnList representing all the columns in the target */ FromBaseTable fbt = (FromBaseTable) (getNodeFactory().getNode( C_NodeTypes.FROM_BASE_TABLE, targetTableName, ...
protected FromBaseTable getResultColumnList(ResultColumnList inputRcl) throws StandardException { /* Get a ResultColumnList representing all the columns in the target */ FromBaseTable fbt = (FromBaseTable) (getNodeFactory().getNode( C_NodeTypes.FROM_BASE_TABLE, synonymTableName != nul...
public static void main(String[] args) throws SQLException, IOException, InterruptedException, Exception, Throwable { Connection conn = null; if (args.length == 1) { driver_type = args[0]; if (!((driver_type.equalsIgnoreCase("DerbyClient")) || (driver_type .equalsIgnoreCase("Embedded")))) { ...
public static void main(String[] args) throws SQLException, IOException, InterruptedException, Exception, Throwable { Connection conn = null; if (args.length == 1) { driver_type = args[0]; if (!((driver_type.equalsIgnoreCase("DerbyClient")) || (driver_type .equalsIgnoreCase("Embedded")))) { ...
private void insertRow(String key) throws IOException { RowMutation rm = new RowMutation("Keyspace1", key.getBytes()); ColumnFamily cf = ColumnFamily.create("Keyspace1", "Standard1"); cf.addColumn(column("col1", "val1", 1L)); rm.add(cf); rm.apply(); }
private void insertRow(String key) throws IOException { RowMutation rm = new RowMutation("Keyspace1", key.getBytes()); ColumnFamily cf = ColumnFamily.create("Keyspace1", "Standard1"); cf.addColumn(column("col1", "val1", new TimestampClock(1L))); rm.add(cf); rm.apply(); ...
public void testGetColumn() throws IOException, ColumnFamilyNotDefinedException { Table table = Table.open("Keyspace1"); RowMutation rm; DecoratedKey dk = Util.dk("key1"); // add data rm = new RowMutation("Keyspace1", dk.key); rm.add(new QueryPath("Standard1", nu...
public void testGetColumn() throws IOException, ColumnFamilyNotDefinedException { Table table = Table.open("Keyspace1"); RowMutation rm; DecoratedKey dk = Util.dk("key1"); // add data rm = new RowMutation("Keyspace1", dk.key); rm.add(new QueryPath("Standard1", nu...
private void testCompaction(String columnFamilyName, int insertsPerTable) throws IOException, ExecutionException, InterruptedException { CompactionManager.instance.disableAutoCompaction(); Table table = Table.open("Keyspace1"); ColumnFamilyStore store = table.getColumnFamilyStore(column...
private void testCompaction(String columnFamilyName, int insertsPerTable) throws IOException, ExecutionException, InterruptedException { CompactionManager.instance.disableAutoCompaction(); Table table = Table.open("Keyspace1"); ColumnFamilyStore store = table.getColumnFamilyStore(column...
public void testSpannedIndexPositions() throws IOException, ExecutionException, InterruptedException { RowIndexedReader.BUFFER_SIZE = 40; // each index entry is ~11 bytes, so this will generate lots of spanned entries Table table = Table.open("Keyspace1"); ColumnFamilyStore store = tabl...
public void testSpannedIndexPositions() throws IOException, ExecutionException, InterruptedException { RowIndexedReader.BUFFER_SIZE = 40; // each index entry is ~11 bytes, so this will generate lots of spanned entries Table table = Table.open("Keyspace1"); ColumnFamilyStore store = tabl...
public void testRepeatedDatabaseCreationWithAutoStats() throws SQLException { final String DB_NAME = "derby-memory-test"; final File DB_DIR = new File("system", DB_NAME); DataSource ds = JDBCDataSource.getDataSource(DB_NAME); // using -Xmx32M typically causes the out...
public void testRepeatedDatabaseCreationWithAutoStats() throws SQLException { final String DB_NAME = "derby-memory-test"; final File DB_DIR = new File("system", DB_NAME); DataSource ds = JDBCDataSource.getDataSource(DB_NAME); // using -Xmx32M typically causes the out...
public void eval(MockDirectoryWrapper dir) throws IOException { // Since we throw exc during abort, eg when IW is // attempting to delete files, we will leave // leftovers: dir.setAssertNoUnrefencedFilesOnClose(false); if (doFail) { StackTraceElement[] trace = new Exception...
public void eval(MockDirectoryWrapper dir) throws IOException { // Since we throw exc during abort, eg when IW is // attempting to delete files, we will leave // leftovers: dir.setAssertNoUnrefencedFilesOnClose(false); if (doFail) { StackTraceElement[] trace = new Exception...
synchronized public void closeDocStore(SegmentWriteState state) throws IOException { final int inc = state.numDocsInStore - lastDocID; if (inc > 0) { initFieldsWriter(); fill(state.numDocsInStore - docWriter.getDocStoreOffset()); } if (fieldsWriter != null) { fieldsWriter.close(); ...
synchronized public void closeDocStore(SegmentWriteState state) throws IOException { final int inc = state.numDocsInStore - lastDocID; if (inc > 0) { initFieldsWriter(); fill(state.numDocsInStore - docWriter.getDocStoreOffset()); } if (fieldsWriter != null) { fieldsWriter.close(); ...
public TermsHashConsumerPerThread addThread(TermsHashPerThread termsHashPerThread) { return new TermVectorsTermsWriterPerThread(termsHashPerThread, this); } void createPostings(RawPostingList[] postings, int start, int count) { final int end = start + count; for(int i=start;i<end;i++) postings[...
public TermsHashConsumerPerThread addThread(TermsHashPerThread termsHashPerThread) { return new TermVectorsTermsWriterPerThread(termsHashPerThread, this); } void createPostings(RawPostingList[] postings, int start, int count) { final int end = start + count; for(int i=start;i<end;i++) postings[...
public void setBytesValue(BytesRef value) { if (!(fieldsData instanceof BytesRef)) { throw new IllegalArgumentException("cannot change value type from " + fieldsData.getClass().getSimpleName() + " to BytesRef"); } if (type.indexed()) { throw new IllegalArgumentException("cannot set a Reader va...
public void setBytesValue(BytesRef value) { if (!(fieldsData instanceof BytesRef)) { throw new IllegalArgumentException("cannot change value type from " + fieldsData.getClass().getSimpleName() + " to BytesRef"); } if (type.indexed()) { throw new IllegalArgumentException("cannot set a BytesRef ...
public void copyLearnsAsExpected() { RandomUtils.useTestSeed(); final MersenneTwister gen = new MersenneTwister(1); final Exponential exp = new Exponential(.5, gen); Vector beta = new DenseVector(200); for (Vector.Element element : beta) { int sign = 1; if (gen.nextDouble() < ...
public void copyLearnsAsExpected() { RandomUtils.useTestSeed(); final MersenneTwister gen = new MersenneTwister(1); final Exponential exp = new Exponential(.5, gen); Vector beta = new DenseVector(200); for (Vector.Element element : beta) { int sign = 1; if (gen.nextDouble() < ...
public void test_errorcode() throws Exception { ResultSet rs = null; Connection conn = getConnection(); Statement s = conn.createStatement(); s.executeUpdate( "create table t(i int, s smallint)"); s.executeUpdate( "insert ...
public void test_errorcode() throws Exception { ResultSet rs = null; Connection conn = getConnection(); Statement s = conn.createStatement(); s.executeUpdate( "create table t(i int, s smallint)"); s.executeUpdate( "insert ...
public void testDiskFull() throws IOException { Term searchTerm = new Term("content", "aaa"); int START_COUNT = 157; int END_COUNT = 144; // First build up a starting index: MockDirectoryWrapper startDir = newDirectory(); IndexWriter writer = new IndexWriter(startDir, new...
public void testDiskFull() throws IOException { Term searchTerm = new Term("content", "aaa"); int START_COUNT = 157; int END_COUNT = 144; // First build up a starting index: MockDirectoryWrapper startDir = newDirectory(); IndexWriter writer = new IndexWriter(startDir, new...
public int hashCode() { long h = 0x98761234; // something non-zero for length==0 for (int i = bits.length; --i>=0;) { h ^= bits[i]; h = (h << 1) | (h >>> 31); // rotate left } return (int)((h>>32) ^ h); // fold leftmost bits into right }
public int hashCode() { long h = 0x98761234; // something non-zero for length==0 for (int i = bits.length; --i>=0;) { h ^= bits[i]; h = (h << 1) | (h >>> 63); // rotate left } return (int)((h>>32) ^ h); // fold leftmost bits into right }
public void basicUsageTest() throws Exception { SolrXMLSerializer serializer = new SolrXMLSerializer(); SolrXMLDef solrXMLDef = getTestSolrXMLDef(defaultCoreNameKey, defaultCoreNameVal, peristentKey, persistentVal, sharedLibKey, sharedLibVal, adminPathKey, adminPathVal, shareSchemaKey, ...
public void basicUsageTest() throws Exception { SolrXMLSerializer serializer = new SolrXMLSerializer(); SolrXMLDef solrXMLDef = getTestSolrXMLDef(defaultCoreNameKey, defaultCoreNameVal, peristentKey, persistentVal, sharedLibKey, sharedLibVal, adminPathKey, adminPathVal, shareSchemaKey, ...
public void testMergeWarmer() throws Exception { Directory dir1 = new MockRAMDirectory(); // Enroll warmer MyWarmer warmer = new MyWarmer(); IndexWriter writer = new IndexWriter(dir1, new IndexWriterConfig( TEST_VERSION_CURRENT, new WhitespaceAnalyzer(TEST_VERSION_CURRENT)) .setMaxBuf...
public void testMergeWarmer() throws Exception { Directory dir1 = new MockRAMDirectory(); // Enroll warmer MyWarmer warmer = new MyWarmer(); IndexWriter writer = new IndexWriter(dir1, new IndexWriterConfig( TEST_VERSION_CURRENT, new WhitespaceAnalyzer(TEST_VERSION_CURRENT)) .setMaxBuf...
public void checkpoint(SegmentInfos segmentInfos, boolean isCommit) throws IOException { if (infoStream != null) { message("now checkpoint \"" + segmentInfos.getCurrentSegmentFileName() + "\" [" + segmentInfos.size() + " segments " + "; isCommit = " + isCommit + "]"); } // Try again now to delete ...
public void checkpoint(SegmentInfos segmentInfos, boolean isCommit) throws IOException { if (infoStream != null) { message("now checkpoint \"" + segmentInfos.getCurrentSegmentFileName() + "\" [" + segmentInfos.size() + " segments " + "; isCommit = " + isCommit + "]"); } // Try again now to delete ...
public Filter makeFilter(SpatialArgs args) { final SpatialOperation op = args.getOperation(); if (! SpatialOperation.is(op, SpatialOperation.IsWithin, SpatialOperation.Intersects, SpatialOperation.BBoxWithin, SpatialOperation.BBoxIntersects)) throw new UnsupportedSpatialOperation(op); Shape shape =...
public Filter makeFilter(SpatialArgs args) { final SpatialOperation op = args.getOperation(); if (op != SpatialOperation.Intersects) throw new UnsupportedSpatialOperation(op); Shape shape = args.getShape(); int detailLevel = grid.getLevelForDistance(args.resolveDistErr(ctx, distErrPct)); Li...
public void testFilterWithVariableScanLevel() throws IOException { init(GeohashPrefixTree.getMaxLevelsPossible()); getAddAndVerifyIndexedDocuments(DATA_WORLD_CITIES_POINTS); //execute queries for each prefix grid scan level for(int i = 0; i <= maxLength; i++) { ((RecursivePrefixTreeStrategy)str...
public void testFilterWithVariableScanLevel() throws IOException { init(GeohashPrefixTree.getMaxLevelsPossible()); getAddAndVerifyIndexedDocuments(DATA_WORLD_CITIES_POINTS); //execute queries for each prefix grid scan level for(int i = 0; i <= maxLength; i++) { ((RecursivePrefixTreeStrategy)str...
public void testDiskFull() throws IOException { Term searchTerm = new Term("content", "aaa"); int START_COUNT = 157; int END_COUNT = 144; // First build up a starting index: MockDirectoryWrapper startDir = newDirectory(); IndexWriter writer = new IndexWriter(startDir, new...
public void testDiskFull() throws IOException { Term searchTerm = new Term("content", "aaa"); int START_COUNT = 157; int END_COUNT = 144; // First build up a starting index: MockDirectoryWrapper startDir = newDirectory(); IndexWriter writer = new IndexWriter(startDir, new...
public void init(NamedList args) { Integer v = (Integer)args.get("setTermIndexInterval"); if (v != null) { termInfosIndexDivisor = v.intValue(); } }
public void init(NamedList args) { Integer v = (Integer)args.get("setTermIndexDivisor"); if (v != null) { termInfosIndexDivisor = v.intValue(); } }
public void testDeleteFromIndexWriter() throws Exception { boolean optimize = true; Directory dir1 = new MockRAMDirectory(); IndexWriter writer = new IndexWriter(dir1, new IndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer())); writer.setInfoStream(infoStream);
public void testDeleteFromIndexWriter() throws Exception { boolean optimize = true; Directory dir1 = new MockRAMDirectory(); IndexWriter writer = new IndexWriter(dir1, new IndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer()).setReaderTermsIndexDivisor(2)); writer.setInfoStream(infoStream);
private void run(Configuration conf, Path input, Path output, int numTopics, int numWords, double topicSmoothing, int maxIterations) throws IOException, InterruptedException, ClassNotFoundException { ...
private void run(Configuration conf, Path input, Path output, int numTopics, int numWords, double topicSmoothing, int maxIterations) throws IOException, InterruptedException, ClassNotFoundException { ...
public void run() { createSnapshot(indexCommit, numberToKeep, replicationHandler); } }.start(); } void createSnapshot(final IndexCommit indexCommit, int numberToKeep, ReplicationHandler replicationHandler) { LOG.info("Creating backup snapshot..."); NamedList<Object> details = new Na...
public void run() { createSnapshot(indexCommit, numberToKeep, replicationHandler); } }.start(); } void createSnapshot(final IndexCommit indexCommit, int numberToKeep, ReplicationHandler replicationHandler) { LOG.info("Creating backup snapshot..."); NamedList<Object> details = new Na...
public static BloomFilter getFilter(long numElements, int targetBucketsPerElem) { int maxBucketsPerElement = Math.max(1, BloomCalculations.maxBucketsPerElement(numElements)); int bucketsPerElement = Math.min(targetBucketsPerElem, maxBucketsPerElement); if (bucketsPerElement < targetBucke...
public static BloomFilter getFilter(long numElements, int targetBucketsPerElem) { int maxBucketsPerElement = Math.max(1, BloomCalculations.maxBucketsPerElement(numElements)); int bucketsPerElement = Math.min(targetBucketsPerElem, maxBucketsPerElement); if (bucketsPerElement < targetBucke...
public void testExpirationTimeDeletionPolicy() throws IOException, InterruptedException { final double SECONDS = 2.0; boolean autoCommit = false; boolean useCompoundFile = true; Directory dir = new RAMDirectory(); ExpirationTimeDeletionPolicy policy = new ExpirationTimeDeletionPolicy(dir, SECON...
public void testExpirationTimeDeletionPolicy() throws IOException, InterruptedException { final double SECONDS = 2.0; boolean autoCommit = false; boolean useCompoundFile = true; Directory dir = new RAMDirectory(); ExpirationTimeDeletionPolicy policy = new ExpirationTimeDeletionPolicy(dir, SECON...
public void testPropsDefaults() throws Exception { IndexWriter writer = new ExposeWriterHandler().getWriter(); ConcurrentMergeScheduler cms = (ConcurrentMergeScheduler)writer.getMergeScheduler(); assertEquals(10, cms.getMaxThreadCount()); }
public void testPropsDefaults() throws Exception { IndexWriter writer = new ExposeWriterHandler().getWriter(); ConcurrentMergeScheduler cms = (ConcurrentMergeScheduler)writer.getMergeScheduler(); assertEquals(4, cms.getMaxThreadCount()); }
public TokenStream init(TokenStream tokenStream) { return null; } }); highlighter.setTextFragmenter(new SimpleFragmenter(2000)); TokenStream tokenStream = analyzer.tokenStream(FIELD_NAME, new StringReader(rawDocContent)); String encodedSnippet = highlighter.getBestFragments(tokenStr...
public TokenStream init(TokenStream tokenStream) { return null; } }); highlighter.setTextFragmenter(new SimpleFragmenter(2000)); TokenStream tokenStream = analyzer.tokenStream(FIELD_NAME, new StringReader(rawDocContent)); String encodedSnippet = highlighter.getBestFragments(tokenStr...
public SSTableSimpleUnsortedWriter(File directory, String keyspace, String columnFamily, AbstractType comparator, AbstractType subComparator, ...
public SSTableSimpleUnsortedWriter(File directory, String keyspace, String columnFamily, AbstractType comparator, AbstractType subComparator, ...
public void testEnablingServer() throws Exception { assertTrue(! healthcheckFile.exists()); // first make sure that ping responds back that the service is disabled SolrQueryResponse sqr = makeRequest(handler, req()); SolrException se = (SolrException) sqr.getException(); assertEquals( "Res...
public void testEnablingServer() throws Exception { assertTrue(! healthcheckFile.exists()); // first make sure that ping responds back that the service is disabled SolrQueryResponse sqr = makeRequest(handler, req()); SolrException se = (SolrException) sqr.getException(); assertEquals( "Res...
private void overwriteStopwords(String stopwords) throws IOException { SolrCore core = h.getCoreContainer().getCore(collection); try { String configDir = core.getResourceLoader().getConfigDir(); FileUtils.moveFile(new File(configDir, "stopwords.txt"), new File(configDir, "stopwords.txt.bak")); ...
private void overwriteStopwords(String stopwords) throws IOException { SolrCore core = h.getCoreContainer().getCore(collection); try { String configDir = core.getResourceLoader().getConfigDir(); FileUtils.moveFile(new File(configDir, "stopwords.txt"), new File(configDir, "stopwords.txt.bak")); ...
private void writeCustomConfig(String coreName, String config, String schema, String rand_snip) throws IOException { File coreRoot = new File(solrHomeDirectory, coreName); File subHome = new File(coreRoot, "conf"); if (!coreRoot.exists()) { assertTrue("Failed to make subdirectory ", coreRoot.mkdirs...
private void writeCustomConfig(String coreName, String config, String schema, String rand_snip) throws IOException { File coreRoot = new File(solrHomeDirectory, coreName); File subHome = new File(coreRoot, "conf"); if (!coreRoot.exists()) { assertTrue("Failed to make subdirectory ", coreRoot.mkdirs...
public TermStats merge(final MergeState mergeState, final DocsEnum postings, final FixedBitSet visitedDocs) throws IOException { int df = 0; long totTF = 0; IndexOptions indexOptions = mergeState.fieldInfo.getIndexOptions(); if (indexOptions == IndexOptions.DOCS_ONLY) { while(true) { f...
public TermStats merge(final MergeState mergeState, final DocsEnum postings, final FixedBitSet visitedDocs) throws IOException { int df = 0; long totTF = 0; IndexOptions indexOptions = mergeState.fieldInfo.getIndexOptions(); if (indexOptions == IndexOptions.DOCS_ONLY) { while(true) { f...
public void merge(MergeState mergeState, TermsEnum termsEnum) throws IOException { BytesRef term; assert termsEnum != null; long sumTotalTermFreq = 0; long sumDocFreq = 0; long sumDFsinceLastAbortCheck = 0; FixedBitSet visitedDocs = new FixedBitSet(mergeState.segmentInfo.getDocCount()); ...
public void merge(MergeState mergeState, TermsEnum termsEnum) throws IOException { BytesRef term; assert termsEnum != null; long sumTotalTermFreq = 0; long sumDocFreq = 0; long sumDFsinceLastAbortCheck = 0; FixedBitSet visitedDocs = new FixedBitSet(mergeState.segmentInfo.getDocCount()); ...
public static final CharArraySet DEFAULT_ARTICLES = CharArraySet.unmodifiableSet( new CharArraySet(Version.LUCENE_CURRENT, Arrays.asList( "l", "m", "t", "qu", "n", "s", "j"), true));
public static final CharArraySet DEFAULT_ARTICLES = CharArraySet.unmodifiableSet( new CharArraySet(Version.LUCENE_CURRENT, Arrays.asList( "l", "m", "t", "qu", "n", "s", "j", "d", "c", "jusqu", "quoiqu", "lorsqu", "puisqu"), true));
public static void beforeTest() throws Exception { initCore(EXAMPLE_CONFIG, EXAMPLE_SCHEMA); }
public static void beforeTest() throws Exception { initCore(EXAMPLE_CONFIG, EXAMPLE_SCHEMA, EXAMPLE_HOME); }
public void run() { try { //wait on messaging service to start listening MessagingService.instance.waitUntilListening(); synchronized( Gossiper.instance ) { /* Update the local heartbeat counter. */...
public void run() { try { //wait on messaging service to start listening MessagingService.instance.waitUntilListening(); synchronized( Gossiper.instance ) { /* Update the local heartbeat counter. */...
private final void invertDocument(Document doc) throws IOException { Enumeration fields = doc.fields(); while (fields.hasMoreElements()) { Fieldable field = (Fieldable) fields.nextElement(); String fieldName = field.name(); int fieldNumber = fieldInfos.fieldNumber(fieldName); ...
private final void invertDocument(Document doc) throws IOException { Enumeration fields = doc.fields(); while (fields.hasMoreElements()) { Fieldable field = (Fieldable) fields.nextElement(); String fieldName = field.name(); int fieldNumber = fieldInfos.fieldNumber(fieldName); ...
public void run() { logDroppedMessages(); } }; Timer timer = new Timer("DroppedMessagesLogger"); timer.schedule(logDropped, LOG_DROPPED_INTERVAL_IN_MS, LOG_DROPPED_INTERVAL_IN_MS); MBeanServer mbs = ManagementFactory.getPlatformMBeanSe...
public void run() { logDroppedMessages(); } }; Timer timer = new Timer("DroppedMessagesLogger"); timer.schedule(logDropped, LOG_DROPPED_INTERVAL_IN_MS, LOG_DROPPED_INTERVAL_IN_MS); MBeanServer mbs = ManagementFactory.getPlatformMBeanSe...
public static final long KEEPALIVE = 60; // seconds to keep "extra" threads alive for when idle static { stages.put(Stage.MUTATION, multiThreadedConfigurableStage(Stage.MUTATION, getConcurrentWriters())); stages.put(Stage.READ, multiThreadedConfigurableStage(Stage.READ, getConcurrentReaders...
public static final long KEEPALIVE = 60; // seconds to keep "extra" threads alive for when idle static { stages.put(Stage.MUTATION, multiThreadedConfigurableStage(Stage.MUTATION, getConcurrentWriters())); stages.put(Stage.READ, multiThreadedConfigurableStage(Stage.READ, getConcurrentReaders...
public synchronized void start(BundleContext context, final String consumerHeaderName) throws Exception { bundleContext = context; logServiceTracker = new LogServiceTracker(context); logServiceTracker.open(); providerBundleTracker = new BundleTracker(context, Bundle...
public synchronized void start(BundleContext context, final String consumerHeaderName) throws Exception { bundleContext = context; logServiceTracker = new LogServiceTracker(context); logServiceTracker.open(); providerBundleTracker = new BundleTracker(context, Bundle...
public static void main(String[] args) { try { Directory directory = new RAMDirectory(); Analyzer analyzer = new SimpleAnalyzer(); IndexWriter writer = new IndexWriter(directory, analyzer, true); String[] docs = { "a b c d e", "a b c d e a b c d e", "a b c d e f g h i j", "a c e", ...
public static void main(String[] args) { try { Directory directory = new RAMDirectory(); Analyzer analyzer = new SimpleAnalyzer(); IndexWriter writer = new IndexWriter(directory, analyzer, true); String[] docs = { "a b c d e", "a b c d e a b c d e", "a b c d e f g h i j", "a c e", ...
public static void test() throws Exception { File file = new File("words.txt"); System.out.println(" reading word file containing " + file.length() + " bytes"); Date start = new Date(); Vector keys = new Vector(); FileInputStream ws = new FileInputStream(file); BufferedR...
public static void test() throws Exception { File file = new File("words.txt"); System.out.println(" reading word file containing " + file.length() + " bytes"); Date start = new Date(); Vector keys = new Vector(); FileInputStream ws = new FileInputStream(file); BufferedR...
private final void add(String name, boolean isIndexed) { FieldInfo fi = fieldInfo(name); if (fi == null) addInternal(name, isIndexed); else if (fi.isIndexed != isIndexed) throw new IllegalStateException("field " + name + (fi.isIndexed ? " must" : " cannot") + " be an indexe...
private Hashtable byName = new Hashtable(); FieldInfos() { add("", false); } FieldInfos(Directory d, String name) throws IOException { InputStream input = d.openFile(name); try { read(input); } finally { input.close(); } } /** Adds field info for a Document. */ final voi...
public void setParams(String sortField) { super.setParams(sortField); String[] fields = sortField.split(","); SortField[] sortFields = new SortField[fields.length]; for (int i = 0; i < fields.length; i++) { String field = fields[i]; int index = field.lastIndexOf(":"); String fieldNam...
public void setParams(String sortField) { super.setParams(sortField); String[] fields = sortField.split(","); SortField[] sortFields = new SortField[fields.length]; for (int i = 0; i < fields.length; i++) { String field = fields[i]; int index = field.lastIndexOf(":"); String fieldNam...
private boolean deleteOnCleanup; SSTableDeletingReference(SSTableTracker tracker, SSTableReader referent, ReferenceQueue<? super SSTableReader> q) { super(referent, q); this.tracker = tracker; this.path = referent.path; this.size = referent.bytesOnDisk(); }
private boolean deleteOnCleanup; SSTableDeletingReference(SSTableTracker tracker, SSTableReader referent, ReferenceQueue<? super SSTableReader> q) { super(referent, q); this.tracker = tracker; this.path = referent.getFilename(); this.size = referent.bytesOnDisk(); }
public final void apply() throws IOException, ConfigurationException { // ensure migration is serial. don't apply unless the previous version matches. if (!DatabaseDescriptor.getDefsVersion().equals(lastVersion)) throw new ConfigurationException("Previous version mismatch. cannot app...
public final void apply() throws IOException, ConfigurationException { // ensure migration is serial. don't apply unless the previous version matches. if (!DatabaseDescriptor.getDefsVersion().equals(lastVersion)) throw new ConfigurationException("Previous version mismatch. cannot app...
public CoreDescriptor(CoreContainer container, String name, String instanceDir, Properties coreProps, SolrParams params) { this.coreContainer = container; originalCoreProperties.setProperty(CORE_NAME, name); originalCoreProperties.setProperty(CORE_INSTDIR, instanceDir); Prop...
public CoreDescriptor(CoreContainer container, String name, String instanceDir, Properties coreProps, SolrParams params) { this.coreContainer = container; originalCoreProperties.setProperty(CORE_NAME, name); originalCoreProperties.setProperty(CORE_INSTDIR, instanceDir); Prop...
public void testMaxDocs() throws Exception { DirectUpdateHandler2 updater = (DirectUpdateHandler2)SolrCore.getSolrCore().getUpdateHandler(); DirectUpdateHandler2.CommitTracker tracker = updater.tracker; tracker.timeUpperBound = -1; tracker.docsUpperBound = 14; XmlUpdateRequestHandler han...
public void testMaxDocs() throws Exception { DirectUpdateHandler2 updater = (DirectUpdateHandler2)SolrCore.getSolrCore().getUpdateHandler(); DirectUpdateHandler2.CommitTracker tracker = updater.tracker; tracker.timeUpperBound = 100000; tracker.docsUpperBound = 14; XmlUpdateRequestHandler...
private void parseFieldList(String[] fl, SolrQueryRequest req) { _wantsScore = false; _wantsAllFields = false; if (fl == null || fl.length == 0 || fl.length == 1 && fl[0].length()==0) { _wantsAllFields = true; return; } NamedList<String> rename = new NamedList<String>(); DocTransf...
private void parseFieldList(String[] fl, SolrQueryRequest req) { _wantsScore = false; _wantsAllFields = false; if (fl == null || fl.length == 0 || fl.length == 1 && fl[0].length()==0) { _wantsAllFields = true; return; } NamedList<String> rename = new NamedList<String>(); DocTransf...
final InputSource src = SystemIdResolver.this.resolveEntity(null, publicId, baseURI, systemId); return (src == null) ? null : src.getByteStream(); } catch (IOException ioe) { throw new XMLStreamException("Cannot resolve entity", ioe); } } }; } URI resolveRe...
final InputSource src = SystemIdResolver.this.resolveEntity(null, publicId, baseURI, systemId); return (src == null) ? null : src.getByteStream(); } catch (IOException ioe) { throw new XMLStreamException("Cannot resolve entity", ioe); } } }; } URI resolveRe...
private void doDelete(DeleteUpdateCommand cmd, List<Node> nodes, ModifiableSolrParams params) throws IOException { flushAdds(1); DeleteUpdateCommand clonedCmd = clone(cmd); DeleteRequest deleteRequest = new DeleteRequest(); deleteRequest.cmd = clonedCmd; deleteRequest.params = para...
private void doDelete(DeleteUpdateCommand cmd, List<Node> nodes, ModifiableSolrParams params) { flushAdds(1); DeleteUpdateCommand clonedCmd = clone(cmd); DeleteRequest deleteRequest = new DeleteRequest(); deleteRequest.cmd = clonedCmd; deleteRequest.params = params; for (Node n...
public void reset(Reader input) throws IOException { try { sentenceTokenizer.reset(input); wordTokenFilter = (TokenStream) tokenFilterClass.getConstructor( TokenStream.class).newInstance(sentenceTokenizer); term = wordTokenFilter.addAttribute(CharTermAttribute.c...
public void reset(Reader input) { try { sentenceTokenizer.reset(input); wordTokenFilter = (TokenStream) tokenFilterClass.getConstructor( TokenStream.class).newInstance(sentenceTokenizer); term = wordTokenFilter.addAttribute(CharTermAttribute.class); } ca...
public int[] getArray() { return prefetchParentOrdinal; } /** * refreshPrefetch() refreshes the parent array. Initially, it fills the * array from the positions of an appropriate posting list. If called during * a refresh(), when the arrays already exist, only values for new documents * (those be...
public int[] getArray() { return prefetchParentOrdinal; } /** * refreshPrefetch() refreshes the parent array. Initially, it fills the * array from the positions of an appropriate posting list. If called during * a refresh(), when the arrays already exist, only values for new documents * (those be...
public static void main(String[] args) throws IOException, ClassNotFoundException { DictionaryFormat format; if (args[0].equalsIgnoreCase("ipadic")) { format = DictionaryFormat.IPADIC; } else if (args[0].equalsIgnoreCase("unidic")) { format = DictionaryFormat.UNIDIC; } else { System....
public static void main(String[] args) throws IOException { DictionaryFormat format; if (args[0].equalsIgnoreCase("ipadic")) { format = DictionaryFormat.IPADIC; } else if (args[0].equalsIgnoreCase("unidic")) { format = DictionaryFormat.UNIDIC; } else { System.err.println("Illegal for...
public static void main(String args[]) throws Exception { outputHeader(); outputMacro("ALetterSupp", "[:WordBreak=ALetter:]"); outputMacro("FormatSupp", "[:WordBreak=Format:]"); outputMacro("ExtendSupp", "[:WordBreak=Extend:]"); outputMacro("NumericSupp", "[:WordB...
public static void main(String args[]) { outputHeader(); outputMacro("ALetterSupp", "[:WordBreak=ALetter:]"); outputMacro("FormatSupp", "[:WordBreak=Format:]"); outputMacro("ExtendSupp", "[:WordBreak=Extend:]"); outputMacro("NumericSupp", "[:WordBreak=Numeric:]");...
public static void main(String args[]) throws Exception { outputHeader(); outputMacro("ID_Start_Supp", "[:ID_Start:]"); outputMacro("ID_Continue_Supp", "[:ID_Continue:]"); } static void outputHeader() { System.out.print(APACHE_LICENSE); System.out.print("// Generated using ICU4J " + VersionIn...
public static void main(String args[]) { outputHeader(); outputMacro("ID_Start_Supp", "[:ID_Start:]"); outputMacro("ID_Continue_Supp", "[:ID_Continue:]"); } static void outputHeader() { System.out.print(APACHE_LICENSE); System.out.print("// Generated using ICU4J " + VersionInfo.ICU_VERSION.to...
public void end() throws IOException { // set final offset final int finalOffset = correctOffset(tokenEnd); offsetAtt.setOffset(finalOffset, finalOffset); } }
public void end() { // set final offset final int finalOffset = correctOffset(tokenEnd); offsetAtt.setOffset(finalOffset, finalOffset); } }
public void end() throws IOException { // set final offset final int finalOffset = correctOffset(scanner.yychar() + scanner.yylength()); this.offsetAtt.setOffset(finalOffset, finalOffset); } }
public void end() { // set final offset final int finalOffset = correctOffset(scanner.yychar() + scanner.yylength()); this.offsetAtt.setOffset(finalOffset, finalOffset); } }
private void addInternal(CharsRef synset[], int size) throws IOException { if (size <= 1) { return; // nothing to do } if (expand) { for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { add(synset[i], synset[j], false); } } } else { f...
private void addInternal(CharsRef synset[], int size) { if (size <= 1) { return; // nothing to do } if (expand) { for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { add(synset[i], synset[j], false); } } } else { for (int i = 0; i < ...
public static void main(String[] args) throws Exception { TernaryTree tt = new TernaryTree(); tt.insert("Carlos", 'C'); tt.insert("Car", 'r'); tt.insert("palos", 'l'); tt.insert("pa", 'p'); tt.trimToSize(); System.out.println((char) tt.find("Car")); System.out.println((char) tt.find("C...
public static void main(String[] args) { TernaryTree tt = new TernaryTree(); tt.insert("Carlos", 'C'); tt.insert("Car", 'r'); tt.insert("palos", 'l'); tt.insert("pa", 'p'); tt.trimToSize(); System.out.println((char) tt.find("Car")); System.out.println((char) tt.find("Carlos")); Sys...
protected boolean accept() throws IOException { return useWhiteList == stopTypes.contains(typeAttribute.type()); } }
protected boolean accept() { return useWhiteList == stopTypes.contains(typeAttribute.type()); } }
private MultiPhraseQuery randomPhraseQuery(long seed) throws Exception { Random random = new Random(seed); int length = _TestUtil.nextInt(random, 2, 5); MultiPhraseQuery pq = new MultiPhraseQuery(); int position = 0; for (int i = 0; i < length; i++) { int depth = _TestUtil.nextInt(random, 1,...
private MultiPhraseQuery randomPhraseQuery(long seed) { Random random = new Random(seed); int length = _TestUtil.nextInt(random, 2, 5); MultiPhraseQuery pq = new MultiPhraseQuery(); int position = 0; for (int i = 0; i < length; i++) { int depth = _TestUtil.nextInt(random, 1, 3); Term t...
private void checkInvariants(IndexWriter writer) throws IOException { writer.waitForMerges(); int maxBufferedDocs = writer.getConfig().getMaxBufferedDocs(); int mergeFactor = ((LogMergePolicy) writer.getConfig().getMergePolicy()).getMergeFactor(); int maxMergeDocs = ((LogMergePolicy) writer.getConfig(...
private void checkInvariants(IndexWriter writer) { writer.waitForMerges(); int maxBufferedDocs = writer.getConfig().getMaxBufferedDocs(); int mergeFactor = ((LogMergePolicy) writer.getConfig().getMergePolicy()).getMergeFactor(); int maxMergeDocs = ((LogMergePolicy) writer.getConfig().getMergePolicy())...
private String runAndReturnSyserr() throws Exception { JUnitCore.runClasses(Nested.class); String err = getSysErr(); // super.prevSysErr.println("Type: " + type + ", point: " + where + " resulted in:\n" + err); // super.prevSysErr.println("---"); return err; } }
private String runAndReturnSyserr() { JUnitCore.runClasses(Nested.class); String err = getSysErr(); // super.prevSysErr.println("Type: " + type + ", point: " + where + " resulted in:\n" + err); // super.prevSysErr.println("---"); return err; } }
public Writer(Directory dir, String id, Comparator<BytesRef> comp, Counter bytesUsed, IOContext context, float acceptableOverheadRatio) throws IOException { super(dir, id, CODEC_NAME_IDX, CODEC_NAME_DAT, VERSION_CURRENT, bytesUsed, context, acceptableOverheadRatio, Type.BYTES_FIXED_SORTED); this...
public Writer(Directory dir, String id, Comparator<BytesRef> comp, Counter bytesUsed, IOContext context, float acceptableOverheadRatio) { super(dir, id, CODEC_NAME_IDX, CODEC_NAME_DAT, VERSION_CURRENT, bytesUsed, context, acceptableOverheadRatio, Type.BYTES_FIXED_SORTED); this.comp = comp; }...
public Writer(Directory dir, String id, Comparator<BytesRef> comp, Counter bytesUsed, IOContext context, float acceptableOverheadRatio) throws IOException { super(dir, id, CODEC_NAME_IDX, CODEC_NAME_DAT, VERSION_CURRENT, bytesUsed, context, acceptableOverheadRatio, Type.BYTES_VAR_SORTED); this.c...
public Writer(Directory dir, String id, Comparator<BytesRef> comp, Counter bytesUsed, IOContext context, float acceptableOverheadRatio) { super(dir, id, CODEC_NAME_IDX, CODEC_NAME_DAT, VERSION_CURRENT, bytesUsed, context, acceptableOverheadRatio, Type.BYTES_VAR_SORTED); this.comp = comp; s...
public DisjunctionMaxScorer(Weight weight, float tieBreakerMultiplier, Scorer[] subScorers, int numScorers) throws IOException { super(weight); this.tieBreakerMultiplier = tieBreakerMultiplier; // The passed subScorers array includes only scorers which have documents // (DisjunctionMaxQuery take...
public DisjunctionMaxScorer(Weight weight, float tieBreakerMultiplier, Scorer[] subScorers, int numScorers) { super(weight); this.tieBreakerMultiplier = tieBreakerMultiplier; // The passed subScorers array includes only scorers which have documents // (DisjunctionMaxQuery takes care of that), an...
private final Similarity.ExactSimScorer docScorer; /** * Construct a <code>TermScorer</code>. * * @param weight * The weight of the <code>Term</code> in the query. * @param td * An iterator over the documents matching the <code>Term</code>. * @param docScorer * ...
private final Similarity.ExactSimScorer docScorer; /** * Construct a <code>TermScorer</code>. * * @param weight * The weight of the <code>Term</code> in the query. * @param td * An iterator over the documents matching the <code>Term</code>. * @param docScorer * ...
private final Bits liveDocs; MatchAllScorer(IndexReader reader, Bits liveDocs, Weight w, float score) throws IOException { super(w); this.liveDocs = liveDocs; this.score = score; maxDoc = reader.maxDoc(); }
private final Bits liveDocs; MatchAllScorer(IndexReader reader, Bits liveDocs, Weight w, float score) { super(w); this.liveDocs = liveDocs; this.score = score; maxDoc = reader.maxDoc(); }
private final Similarity.ExactSimScorer docScorer; /** * Construct a <code>TermScorer</code>. * * @param weight * The weight of the <code>Term</code> in the query. * @param td * An iterator over the documents matching the <code>Term</code>. * @param docScorer * ...
private final Similarity.ExactSimScorer docScorer; /** * Construct a <code>TermScorer</code>. * * @param weight * The weight of the <code>Term</code> in the query. * @param td * An iterator over the documents matching the <code>Term</code>. * @param docScorer * ...
public void addField(IndexableField field, FieldInfo fieldInfo) throws IOException { if (numStoredFields == storedFields.length) { int newSize = ArrayUtil.oversize(numStoredFields + 1, RamUsageEstimator.NUM_BYTES_OBJECT_REF); IndexableField[] newArray = new IndexableField[newSize]; System.arrayc...
public void addField(IndexableField field, FieldInfo fieldInfo) { if (numStoredFields == storedFields.length) { int newSize = ArrayUtil.oversize(numStoredFields + 1, RamUsageEstimator.NUM_BYTES_OBJECT_REF); IndexableField[] newArray = new IndexableField[newSize]; System.arraycopy(storedFields, 0...
public TermsHashConsumerPerField addField(TermsHashPerField termsHashPerField, FieldInfo fieldInfo) { return new TermVectorsConsumerPerField(termsHashPerField, this, fieldInfo); } void addFieldToFlush(TermVectorsConsumerPerField fieldToFlush) { if (numVectorFields == perFields.length) { int newSize...
public TermsHashConsumerPerField addField(TermsHashPerField termsHashPerField, FieldInfo fieldInfo) { return new TermVectorsConsumerPerField(termsHashPerField, this, fieldInfo); } void addFieldToFlush(TermVectorsConsumerPerField fieldToFlush) { if (numVectorFields == perFields.length) { int newSize...
public void abort() {} /** Called once per field per document if term vectors * are enabled, to write the vectors to * RAMOutputStream, which is then quickly flushed to * the real term vectors files in the Directory. */ @Override void finish() throws IOException { if (!doVectors || termsHashPerF...
public void abort() {} /** Called once per field per document if term vectors * are enabled, to write the vectors to * RAMOutputStream, which is then quickly flushed to * the real term vectors files in the Directory. */ @Override void finish() { if (!doVectors || termsHashPerField.bytesHash.size...
public MergeSpecification findForcedDeletesMerges(SegmentInfos segmentInfos) throws CorruptIndexException, IOException { final List<SegmentInfoPerCommit> segments = segmentInfos.asList(); final int numSegments = segments.size(); if (verbose()) { message("findForcedDeleteMerges: " + numSegment...
public MergeSpecification findForcedDeletesMerges(SegmentInfos segmentInfos) throws IOException { final List<SegmentInfoPerCommit> segments = segmentInfos.asList(); final int numSegments = segments.size(); if (verbose()) { message("findForcedDeleteMerges: " + numSegments + " segments"); }...
public MultiDocsEnum(MultiTermsEnum parent, int subReaderCount) { this.parent = parent; subDocsEnum = new DocsEnum[subReaderCount]; } MultiDocsEnum reset(final EnumWithSlice[] subs, final int numSubs) throws IOException { this.numSubs = numSubs; this.subs = new EnumWithSlice[subs.length]; fo...
public MultiDocsEnum(MultiTermsEnum parent, int subReaderCount) { this.parent = parent; subDocsEnum = new DocsEnum[subReaderCount]; } MultiDocsEnum reset(final EnumWithSlice[] subs, final int numSubs) { this.numSubs = numSubs; this.subs = new EnumWithSlice[subs.length]; for(int i=0;i<subs.le...
public void work(double units) throws MergePolicy.MergeAbortedException { // do nothing } }; } }
public void work(double units) { // do nothing } }; } }
public static void run(Configuration conf, Path input, Path output, int numDims, int clusters, DistanceMeasure measure, double convergenceDelta, ...
public static void run(Configuration conf, Path input, Path output, int numDims, int clusters, DistanceMeasure measure, double convergenceDelta, ...
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 void write(TextResponseWriter writer, String name, IndexableField f) throws IOException { writer.writeStr(name, f.stringValue(), false); }
public void write(TextResponseWriter writer, String name, IndexableField f) throws IOException { writer.writeStr(name, f.stringValue(), true); }
public void write(TextResponseWriter writer, String name, IndexableField field) throws IOException { writer.writeStr(name, field.stringValue(), false); }
public void write(TextResponseWriter writer, String name, IndexableField field) throws IOException { writer.writeStr(name, field.stringValue(), true); }
public static IndexReader maybeWrapReader(IndexReader r) throws IOException { Random random = random(); if (rarely()) { // TODO: remove this, and fix those tests to wrap before putting slow around: final boolean wasOriginallyAtomic = r instanceof AtomicReader; for (int i = 0, c = random.next...
public static IndexReader maybeWrapReader(IndexReader r) throws IOException { Random random = random(); if (rarely()) { // TODO: remove this, and fix those tests to wrap before putting slow around: final boolean wasOriginallyAtomic = r instanceof AtomicReader; for (int i = 0, c = random.next...
protected void doFieldSortValues(ResponseBuilder rb, SolrIndexSearcher searcher) throws IOException { SolrQueryRequest req = rb.req; SolrQueryResponse rsp = rb.rsp; // The query cache doesn't currently store sort field values, and SolrIndexSearcher doesn't // currently have an option to return sort...
protected void doFieldSortValues(ResponseBuilder rb, SolrIndexSearcher searcher) throws IOException { SolrQueryRequest req = rb.req; SolrQueryResponse rsp = rb.rsp; // The query cache doesn't currently store sort field values, and SolrIndexSearcher doesn't // currently have an option to return sort...
public TopGroupSortCollector(ValueSource groupByVS, Map vsContext, Sort sort, Sort groupSort, int nGroups) throws IOException { super(groupByVS, vsContext, sort, nGroups); this.groupSort = groupSort; } void constructComparators(FieldComparator[] comparators, int[] reversed, SortField[] sortFields, int si...
public TopGroupSortCollector(ValueSource groupByVS, Map vsContext, Sort sort, Sort groupSort, int nGroups) throws IOException { super(groupByVS, vsContext, sort, nGroups); this.groupSort = groupSort; } void constructComparators(FieldComparator[] comparators, int[] reversed, SortField[] sortFields, int si...