buggy_function
stringlengths
1
391k
fixed_function
stringlengths
0
392k
private void reportAdditionalFailureInfo(final String testName) { if (TEST_LINE_DOCS_FILE.endsWith(JENKINS_LARGE_LINE_DOCS_FILE)) { System.err.println("NOTE: download the large Jenkins line-docs file by running " + "'ant get-jenkins-line-docs' in the lucene directory."); } final StringBuild...
private void reportAdditionalFailureInfo(final String testName) { if (TEST_LINE_DOCS_FILE.endsWith(JENKINS_LARGE_LINE_DOCS_FILE)) { System.err.println("NOTE: download the large Jenkins line-docs file by running " + "'ant get-jenkins-line-docs' in the lucene directory."); } final StringBuild...
private static boolean sendMessage(InetAddress endpoint, String tableName, byte[] key) throws IOException { if (!Gossiper.instance.isKnownEndpoint(endpoint)) { logger_.warn("Hints found for endpoint " + endpoint + " which is not part of the gossip network. discarding."); ...
private static boolean sendMessage(InetAddress endpoint, String tableName, byte[] key) throws IOException { if (!Gossiper.instance.isKnownEndpoint(endpoint)) { logger_.warn("Hints found for endpoint " + endpoint + " which is not part of the gossip network. discarding."); ...
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 String[] getEndpointInfo(InetAddress endpoint) { String key = endpoint.toString(); String value = hostProperties.getProperty(key); if (value == null) { logger_.error("Could not find end point information for {}, will use default.", key); value = hostPro...
public String[] getEndpointInfo(InetAddress endpoint) { String key = endpoint.getHostAddress(); String value = hostProperties.getProperty(key); if (value == null) { logger_.error("Could not find end point information for {}, will use default.", key); value = h...
private void endXA(Xid xid, int xaflags) throws DRDAProtocolException { XAResource xaResource = getXAResource(); int xaRetVal = xaResource.XA_OK; try { xaResource.end(xid,xaflags); xid = null; if (SanityManager.DEBUG) { connThread.trace("ended XA transaction. xid = " + xid + ...
private void endXA(Xid xid, int xaflags) throws DRDAProtocolException { XAResource xaResource = getXAResource(); int xaRetVal = xaResource.XA_OK; try { xaResource.end(xid,xaflags); this.xid = null; if (SanityManager.DEBUG) { connThread.trace("ended XA transaction. xid = " + xid + ...
public void compressContainer(BaseContainerHandle handle) throws StandardException { RawTransaction ntt = handle.getTransaction().startNestedTopTransaction(); int mode = handle.getMode(); if (SanityManager.DEBUG) { SanityManager.ASSERT((mode & ContainerHandle.MODE_FORUPDATE) == Conta...
public void compressContainer(BaseContainerHandle handle) throws StandardException { RawTransaction ntt = handle.getTransaction().startNestedTopTransaction(); int mode = handle.getMode(); if (SanityManager.DEBUG) { SanityManager.ASSERT((mode & ContainerHandle.MODE_FORUPDATE) == Conta...
public void undoMe( Transaction xact, BasePage undoPage, LogInstant CLRInstant, LimitObjectInput in) throws StandardException { if (SanityManager.DEBUG) { SanityManager.ASSERT(undoPage != null, "undo Page null"); SanityManager.ASSERT( ...
public void undoMe( Transaction xact, BasePage undoPage, LogInstant CLRInstant, LimitObjectInput in) throws StandardException { if (SanityManager.DEBUG) { SanityManager.ASSERT(undoPage != null, "undo Page null"); SanityManager.ASSERT( ...
public PlainTextDictionary (InputStream dictFile) { in=new BufferedReader(new InputStreamReader(System.in)); }
public PlainTextDictionary (InputStream dictFile) { in=new BufferedReader(new InputStreamReader(dictFile)); }
public static final String DEF_SOLR_XML = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" + "<solr persistent=\"false\">\n" + " <cores adminPath=\"/admin/cores\" defaultCoreName=\"" + CoreContainer.DEFAULT_DEFAULT_CORE_NAME + "\"" + " host=\"${host:}\" hostPort=\"${hostPort:}\...
public static final String DEF_SOLR_XML = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" + "<solr persistent=\"false\">\n" + " <cores adminPath=\"/admin/cores\" defaultCoreName=\"" + CoreContainer.DEFAULT_DEFAULT_CORE_NAME + "\"" + " host=\"${host:}\" hostPort=\"${hostPort:}\...
protected Reader initReader(Reader reader) { return matchVersion.onOrAfter(Version.LUCENE_31) ? new PersianCharFilter(CharReader.get(reader)) : reader; } }
protected Reader initReader(String fieldName, Reader reader) { return matchVersion.onOrAfter(Version.LUCENE_31) ? new PersianCharFilter(CharReader.get(reader)) : reader; } }
public void testHashCodeAndEquals() { int num = atLeast(100); final boolean singleField = random().nextBoolean(); List<Term> terms = new ArrayList<Term>(); Set<Term> uniqueTerms = new HashSet<Term>(); for (int i = 0; i < num; i++) { String field = "field" + (singleField ? "1" : random().next...
public void testHashCodeAndEquals() { int num = atLeast(100); final boolean singleField = random().nextBoolean(); List<Term> terms = new ArrayList<Term>(); Set<Term> uniqueTerms = new HashSet<Term>(); for (int i = 0; i < num; i++) { String field = "field" + (singleField ? "1" : random().next...
public void map(IntWritable docId, VectorWritable document, Context context) throws IOException, InterruptedException{ /* where to get docTopics? */ Vector topicVector = new DenseVector(new double[numTopics]).assign(1/numTopics); modelTrainer.train(document.get(), topicVector, true, maxIters); }
public void map(IntWritable docId, VectorWritable document, Context context) throws IOException, InterruptedException{ /* where to get docTopics? */ Vector topicVector = new DenseVector(new double[numTopics]).assign(1.0/numTopics); modelTrainer.train(document.get(), topicVector, true, maxIters); }...
private JobContext getJobContext(Configuration conf, JobID jobID) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException { Class<? extends JobContext> clazz = null; if (!JobContext.class.isInterface()) { clazz = JobCont...
private JobContext getJobContext(Configuration conf, JobID jobID) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException { Class<? extends JobContext> clazz; if (!JobContext.class.isInterface()) { clazz = JobContext.cla...
private static void populateFieldInfo(IndexSchema schema, Map<String, List<String>> typeusemap, Map<String, Object> fields, SchemaField uniqueField, SchemaField f) { FieldType ft = f.getType(); SimpleOrderedMap<Object> field = new...
private static void populateFieldInfo(IndexSchema schema, Map<String, List<String>> typeusemap, Map<String, Object> fields, SchemaField uniqueField, SchemaField f) { FieldType ft = f.getType(); SimpleOrderedMap<Object> field = new...
public ResultColumn bindColumnReference(ColumnReference columnReference) throws StandardException { boolean columnNameMatch = false; boolean tableNameMatch = false; FromTable fromTable; int currentLevel = -1; int previousLevel = -1; ResultColumn matchingRC = null; ResultColumn resultColum...
public ResultColumn bindColumnReference(ColumnReference columnReference) throws StandardException { boolean columnNameMatch = false; boolean tableNameMatch = false; FromTable fromTable; int currentLevel = -1; int previousLevel = -1; ResultColumn matchingRC = null; ResultColumn resultColum...
public ResultColumn getMatchingColumn(ColumnReference columnReference) throws StandardException { /* Get the logical left and right sides of the join. * (For RIGHT OUTER JOIN, the left is the right * and the right is the left and the JOIN is the NIOJ). */ ResultSetNode logicalLeftRS = getLogicalLeftResul...
public ResultColumn getMatchingColumn(ColumnReference columnReference) throws StandardException { /* Get the logical left and right sides of the join. * (For RIGHT OUTER JOIN, the left is the right * and the right is the left and the JOIN is the NIOJ). */ ResultSetNode logicalLeftRS = getLogicalLeftResul...
public void testGetSliceFromLarge() throws Throwable { // tests slicing against 1000 columns in an sstable Table table = Table.open("Keyspace1"); ColumnFamilyStore cfStore = table.getColumnFamilyStore("Standard1"); String key = "row3"; RowMutation rm = new RowMutation("Ke...
public void testGetSliceFromLarge() throws Throwable { // tests slicing against 1000 columns in an sstable Table table = Table.open("Keyspace1"); ColumnFamilyStore cfStore = table.getColumnFamilyStore("Standard1"); String key = "row3"; RowMutation rm = new RowMutation("Ke...
public void update(Reader reader, Writer writer) { // TODO: add param to specify maximum time to commit? // todo - might be nice to separate command parsing w/ a factory // then new commands could be added w/o risk to old ones XmlPullParser xpp = null; try { xpp = factory.newPullParser()...
public void update(Reader reader, Writer writer) { // TODO: add param to specify maximum time to commit? // todo - might be nice to separate command parsing w/ a factory // then new commands could be added w/o risk to old ones XmlPullParser xpp = null; try { xpp = factory.newPullParser()...
protected final DataValueDescriptor getColumn(int columnIndex) throws SQLException, StandardException { closeCurrentStream(); if (columnIndex < 1 || columnIndex > currentRow.nColumns()) { throw newSQLException(SQLState.COLUMN_NOT_FOUND, new Integer(columnIndex)); } if (isOnInsertRow || cur...
protected final DataValueDescriptor getColumn(int columnIndex) throws SQLException, StandardException { closeCurrentStream(); if (columnIndex < 1 || columnIndex > currentRow.nColumns()) { throw newSQLException(SQLState.COLUMN_NOT_FOUND, new Integer(columnIndex)); } if (isOnInsertRow || cur...
public void collectReducedColumns(IColumnContainer container, Iterator<IColumn> reducedColumns, int gcBefore) { int liveColumns = 0; AbstractType comparator = container.getComparator(); while (reducedColumns.hasNext()) { if (liveColumns >= count) brea...
public void collectReducedColumns(IColumnContainer container, Iterator<IColumn> reducedColumns, int gcBefore) { int liveColumns = 0; AbstractType comparator = container.getComparator(); while (reducedColumns.hasNext()) { if (liveColumns >= count) brea...
public DataValueDescriptor getNewNull() { return null; }
public DataValueDescriptor getNewNull() { return new HeapRowLocation(); }
// private Boolean exprN() // { // return <<restriction.generate(ps)>>; // } // static Method exprN = method pointer to exprN; // Map the result columns to the source columns int[] mapArray = resultColumns.mapSourceColumns(); int mapArrayItem = acb.addItem(new ReferencedColumnsDescr...
// private Boolean exprN() // { // return <<restriction.generate(ps)>>; // } // static Method exprN = method pointer to exprN; // Map the result columns to the source columns int[] mapArray = resultColumns.mapSourceColumns(); int mapArrayItem = acb.addItem(new ReferencedColumnsDescr...
public void map(LongWritable key, Text value, OutputCollector<IntWritable,LongWritable> output, Reporter reporter) throws IOException { String[] tokens = ItemIDIndexMapper.COMMA.split(value.toString()); long itemID = Long.parseLong(tokens[1]); int inde...
public void map(LongWritable key, Text value, OutputCollector<IntWritable,LongWritable> output, Reporter reporter) throws IOException { String[] tokens = ItemIDIndexMapper.COMMA.split(value.toString()); long itemID = Long.parseLong(tokens[1]); int inde...
public static final String LOCK_DIR = System.getProperty("org.apache.lucene.lockdir", System.getProperty("java.io.tmpdir"));
public static final String LOCK_DIR = System.getProperty("org.apache.lucene.lockdir", System.getProperty("java.io.tmpdir", "."));
public synchronized void resetAndTruncate(FileMark mark) throws IOException { assert mark instanceof CompressedFileWriterMark; CompressedFileWriterMark realMark = ((CompressedFileWriterMark) mark); // reset position current = realMark.uncDataOffset; if (realMark.chunkO...
public synchronized void resetAndTruncate(FileMark mark) throws IOException { assert mark instanceof CompressedFileWriterMark; CompressedFileWriterMark realMark = ((CompressedFileWriterMark) mark); // reset position current = realMark.uncDataOffset; if (realMark.chunkO...
protected static CoreDescriptor buildCoreDescriptor(SolrParams params, CoreContainer container) { String name = checkNotEmpty(params.get(CoreAdminParams.NAME), "Missing parameter [" + CoreAdminParams.NAME + "]"); String instancedir = params.get(CoreAdminParams.INSTANCE_DIR); if (StringUtils.isEmp...
protected static CoreDescriptor buildCoreDescriptor(SolrParams params, CoreContainer container) { String name = checkNotEmpty(params.get(CoreAdminParams.NAME), "Missing parameter [" + CoreAdminParams.NAME + "]"); String instancedir = params.get(CoreAdminParams.INSTANCE_DIR); if (StringUtils.isEmp...
public String exportSchema() throws IOException { List<RawKeyspace> keyspaces = new ArrayList<RawKeyspace>(); for (String ksname : DatabaseDescriptor.getNonSystemTables()) { KSMetaData ksm = DatabaseDescriptor.getTableDefinition(ksname); RawKeyspace rks = new RawK...
public String exportSchema() throws IOException { List<RawKeyspace> keyspaces = new ArrayList<RawKeyspace>(); for (String ksname : DatabaseDescriptor.getNonSystemTables()) { KSMetaData ksm = DatabaseDescriptor.getTableDefinition(ksname); RawKeyspace rks = new RawK...
String STORE_DATA_SEG_BACKUP_COMPLETED = "D006"; /* Derby - Class org.apache.derby.iapi.reference.MessageId Copyright 2000, 2004 The Apache Software Foundation or its licensors, as applicable. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance...
String STORE_DATA_SEG_BACKUP_COMPLETED = "D006"; /* Derby - Class org.apache.derby.iapi.reference.MessageId Copyright 2000, 2004 The Apache Software Foundation or its licensors, as applicable. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance...
public synchronized String system_add_keyspace(KsDef ks_def) throws InvalidRequestException, SchemaDisagreementException, TException { logger.debug("add_keyspace"); state().hasKeyspaceSchemaAccess(Permission.WRITE); validateSchemaAgreement(); ThriftValidation.validateKeyspace...
public synchronized String system_add_keyspace(KsDef ks_def) throws InvalidRequestException, SchemaDisagreementException, TException { logger.debug("add_keyspace"); state().hasKeyspaceSchemaAccess(Permission.WRITE); validateSchemaAgreement(); ThriftValidation.validateKeyspace...
// create the private ColumnFamilyStores for the secondary column indexes indexedColumns = new ConcurrentSkipListMap<byte[], ColumnFamilyStore>(getComparator()); for (ColumnDefinition info : metadata.column_metadata.values()) { if (info.index_type != null) add...
// create the private ColumnFamilyStores for the secondary column indexes indexedColumns = new ConcurrentSkipListMap<byte[], ColumnFamilyStore>(getComparator()); for (ColumnDefinition info : metadata.column_metadata.values()) { if (info.index_type != null) add...
public boolean isExpired() { return System.currentTimeMillis() > creationTime + cfs.getMemtableFlushAfterMins() * 60 * 1000; }
public boolean isExpired() { return System.currentTimeMillis() > creationTime + cfs.getMemtableFlushAfterMins() * 60 * 1000L; }
public String getFlushPath() { long guessedSize = 2 * memsize.value() * 1024*1024; // 2* adds room for keys, column indexes String location = DatabaseDescriptor.getDataFileLocationForTable(table.name, guessedSize); if (location == null) throw new RuntimeException("Insufficien...
public String getFlushPath() { long guessedSize = 2L * memsize.value() * 1024*1024; // 2* adds room for keys, column indexes String location = DatabaseDescriptor.getDataFileLocationForTable(table.name, guessedSize); if (location == null) throw new RuntimeException("Insufficie...
public static List<Row> getRangeSlice(RangeSliceCommand command, ConsistencyLevel consistency_level) throws IOException, UnavailableException, TimeoutException { if (logger.isDebugEnabled()) logger.debug(command.toString()); long startTime = System.nanoTime(); List<Row> r...
public static List<Row> getRangeSlice(RangeSliceCommand command, ConsistencyLevel consistency_level) throws IOException, UnavailableException, TimeoutException { if (logger.isDebugEnabled()) logger.debug("Command/ConsistencyLevel is {}/{}", command.toString(), consistency_level); ...
public void testStopList() throws IOException { CharArraySet stopWordsSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("good", "test", "analyzer"), false); StopAnalyzer newStop = new StopAnalyzer(Version.LUCENE_40, stopWordsSet); TokenStream stream = newStop.tokenStream("test", "This is a good test of t...
public void testStopList() throws IOException { CharArraySet stopWordsSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("good", "test", "analyzer"), false); StopAnalyzer newStop = new StopAnalyzer(TEST_VERSION_CURRENT, stopWordsSet); TokenStream stream = newStop.tokenStream("test", "This is a good test o...
public void testEndStopword() throws Exception { CharArraySet stopSet = StopFilter.makeStopSet(TEST_VERSION_CURRENT, "of"); StopFilter stpf = new StopFilter(Version.LUCENE_40, new MockTokenizer(new StringReader("test of"), MockTokenizer.WHITESPACE, false), stopSet); assertTokenStreamContents(stpf, new Str...
public void testEndStopword() throws Exception { CharArraySet stopSet = StopFilter.makeStopSet(TEST_VERSION_CURRENT, "of"); StopFilter stpf = new StopFilter(TEST_VERSION_CURRENT, new MockTokenizer(new StringReader("test of"), MockTokenizer.WHITESPACE, false), stopSet); assertTokenStreamContents(stpf, new ...
public void add(List<String> singleMatch, List<Token> replacement, boolean includeOrig, boolean mergeExisting) { SlowSynonymMap currMap = this; for (String str : singleMatch) { if (currMap.submap==null) { // for now hardcode at 4.0, as its what the old code did. // would be nice to fix, ...
public void add(List<String> singleMatch, List<Token> replacement, boolean includeOrig, boolean mergeExisting) { SlowSynonymMap currMap = this; for (String str : singleMatch) { if (currMap.submap==null) { // for now hardcode at 4.0, as its what the old code did. // would be nice to fix, ...
protected static CharArraySet loadStopwordSet(final boolean ignoreCase, final Class<? extends Analyzer> aClass, final String resource, final String comment) throws IOException { Reader reader = null; try { reader = IOUtils.getDecodingReader(aClass.getResourceAsStream(resource), IOUtils.CHARS...
protected static CharArraySet loadStopwordSet(final boolean ignoreCase, final Class<? extends Analyzer> aClass, final String resource, final String comment) throws IOException { Reader reader = null; try { reader = IOUtils.getDecodingReader(aClass.getResourceAsStream(resource), IOUtils.CHARS...
public RuleWithSetExceptions(String suffix, int min, String replacement, String[] exceptions) { super(suffix, min, replacement); for (int i = 0; i < exceptions.length; i++) { if (!exceptions[i].endsWith(suffix)) throw new RuntimeException("useless exception '" + exceptions[i] +...
public RuleWithSetExceptions(String suffix, int min, String replacement, String[] exceptions) { super(suffix, min, replacement); for (int i = 0; i < exceptions.length; i++) { if (!exceptions[i].endsWith(suffix)) throw new RuntimeException("useless exception '" + exceptions[i] +...
public void baseUIMAAnalyzerIntegrationTest() throws Exception { Directory dir = new RAMDirectory(); IndexWriter writer = new IndexWriter(dir, new IndexWriterConfig(Version.LUCENE_40, analyzer)); // add the first doc Document doc = new Document(); String dummyTitle = "this is a dummy title "; ...
public void baseUIMAAnalyzerIntegrationTest() throws Exception { Directory dir = new RAMDirectory(); IndexWriter writer = new IndexWriter(dir, new IndexWriterConfig(TEST_VERSION_CURRENT, analyzer)); // add the first doc Document doc = new Document(); String dummyTitle = "this is a dummy title "; ...
public static void beforeClass() throws Exception { // TODO: rewrite test (this needs to set QueryParser.enablePositionIncrements, too, for work with CURRENT): Analyzer analyzer = new MockAnalyzer(random(), MockTokenizer.WHITESPACE, true, MockTokenFilter.ENGLISH_STOPSET); //initialize the parser build...
public static void beforeClass() throws Exception { // TODO: rewrite test (this needs to set QueryParser.enablePositionIncrements, too, for work with CURRENT): Analyzer analyzer = new MockAnalyzer(random(), MockTokenizer.WHITESPACE, true, MockTokenFilter.ENGLISH_STOPSET); //initialize the parser build...
private void openExampleIndex() throws IOException { //Create a RAM-based index from our test data file RAMDirectory rd = new RAMDirectory(); IndexWriterConfig iwConfig = new IndexWriterConfig(Version.LUCENE_40, analyzer); IndexWriter writer = new IndexWriter(rd, iwConfig); InputStream dataIn = ge...
private void openExampleIndex() throws IOException { //Create a RAM-based index from our test data file RAMDirectory rd = new RAMDirectory(); IndexWriterConfig iwConfig = new IndexWriterConfig(Version.LUCENE_CURRENT, analyzer); IndexWriter writer = new IndexWriter(rd, iwConfig); InputStream dataIn...
public void testPhraseQueryWithStopAnalyzer() throws Exception { Directory directory = newDirectory(); Analyzer stopAnalyzer = new MockAnalyzer(random(), MockTokenizer.SIMPLE, true, MockTokenFilter.ENGLISH_STOPSET); RandomIndexWriter writer = new RandomIndexWriter(random(), directory, newIndexWri...
public void testPhraseQueryWithStopAnalyzer() throws Exception { Directory directory = newDirectory(); Analyzer stopAnalyzer = new MockAnalyzer(random(), MockTokenizer.SIMPLE, true, MockTokenFilter.ENGLISH_STOPSET); RandomIndexWriter writer = new RandomIndexWriter(random(), directory, newIndexWri...
public void build(InputIterator iterator, double ramBufferSizeMB) throws IOException { if (iterator.hasPayloads()) { throw new IllegalArgumentException("payloads are not supported"); } String prefix = getClass().getSimpleName(); File directory = Sort.defaultTempDir(); // TODO: messy ... jav...
public void build(InputIterator iterator, double ramBufferSizeMB) throws IOException { if (iterator.hasPayloads()) { throw new IllegalArgumentException("payloads are not supported"); } String prefix = getClass().getSimpleName(); File directory = Sort.defaultTempDir(); // TODO: messy ... jav...
public void testLoadNewIndexDir() throws IOException, ParserConfigurationException, SAXException { //add a doc in original index dir assertU(adoc("id", String.valueOf(1), "name", "name"+String.valueOf(1))); //create a new index dir and index.properties file File idxprops = new File(h.getCore()...
public void testLoadNewIndexDir() throws IOException, ParserConfigurationException, SAXException { //add a doc in original index dir assertU(adoc("id", String.valueOf(1), "name", "name"+String.valueOf(1))); //create a new index dir and index.properties file File idxprops = new File(h.getCore()...
private void receiveReply() throws IOException { MessagingService.validateMagic(input.readInt()); int msheader = input.readInt(); assert MessagingService.getBits(msheader, 3, 1) == 0 : "Stream received before stream reply"; int version = MessagingService.getBits(msheader, 15, 8);...
private void receiveReply() throws IOException { MessagingService.validateMagic(input.readInt()); int msheader = input.readInt(); assert MessagingService.getBits(msheader, 3, 1) == 0 : "Stream received before stream reply"; int version = MessagingService.getBits(msheader, 15, 8);...
public int compare(DecoratedKey o1, DecoratedKey o2) { if ((right.compareTo(o1.token) < 0 && right.compareTo(o2.token) < 0) || (right.compareTo(o1.token) > 0 && right.compareTo(o2.token) > 0)) { // bo...
public int compare(DecoratedKey o1, DecoratedKey o2) { if ((right.compareTo(o1.token) < 0 && right.compareTo(o2.token) < 0) || (right.compareTo(o1.token) > 0 && right.compareTo(o2.token) > 0)) { // bo...
private int binarySearch(ByteBuffer name) { int low = 0; int mid = size(); int high = mid - 1; int result = -1; while (low <= high) { mid = (low + high) >> 1; if ((result = -compare(get(mid).name(), name)) > 0) { ...
private int binarySearch(ByteBuffer name) { int low = 0; int mid = size(); int high = mid - 1; int result = -1; while (low <= high) { mid = (low + high) >> 1; if ((result = compare(name, get(mid).name())) > 0) { ...
public int compare(ByteBuffer o1, ByteBuffer o2) { if (o1.remaining() == 0) { return o2.remaining() == 0 ? 0 : -1; } if (o2.remaining() == 0) { return 1; } ...
public int compare(ByteBuffer o1, ByteBuffer o2) { if (o1.remaining() == 0) { return o2.remaining() == 0 ? 0 : -1; } if (o2.remaining() == 0) { return 1; } ...
public void serializeComparator(ByteBuffer bb) { int header = 0; if (isAlias) header = 0x8000 | ((byte)comparatorName.charAt(0)); else header = comparatorName.length(); putShortLength(bb, header); if (!isAlias) ...
public void serializeComparator(ByteBuffer bb) { int header = 0; if (isAlias) header = 0x8000 | (((byte)comparatorName.charAt(0)) & 0xFF); else header = comparatorName.length(); putShortLength(bb, header); if (!...
public int compare(ByteBuffer o1, ByteBuffer o2) { // An empty byte buffer is always smaller if (o1.remaining() == 0) { return o2.remaining() == 0 ? 0 : -1; } if (o2.remaining() == 0) { return 1; } return -baseType.compare(...
public int compare(ByteBuffer o1, ByteBuffer o2) { // An empty byte buffer is always smaller if (o1.remaining() == 0) { return o2.remaining() == 0 ? 0 : -1; } if (o2.remaining() == 0) { return 1; } return baseType.compare(o...
private static void printUsage() { HelpFormatter hf = new HelpFormatter(); StringBuilder header = new StringBuilder(); header.append("\nAvailable commands:\n"); // No args addCmdHelp(header, "ring", "Print informations on the token ring"); addCmdHelp(header, "join...
private static void printUsage() { HelpFormatter hf = new HelpFormatter(); StringBuilder header = new StringBuilder(); header.append("\nAvailable commands:\n"); // No args addCmdHelp(header, "ring", "Print informations on the token ring"); addCmdHelp(header, "join...
public void doVerb(Message message) { StorageService ss = StorageService.instance; String tokenString = StorageService.getPartitioner().getTokenFactory().toString(ss.getBootstrapToken()); Message response = message.getReply(FBUtilities.getLocalAddress(), tokenString.g...
public void doVerb(Message message) { StorageService ss = StorageService.instance; String tokenString = StorageService.getPartitioner().getTokenFactory().toString(ss.getBootstrapToken()); Message response = message.getInternalReply(tokenString.getBytes(Charsets.UTF_8)...
public void doVerb(Message message) { Message reply = message.getReply(FBUtilities.getLocalAddress(), new byte[] {(byte)(isMoveable_.get() ? 1 : 0)}); MessagingService.instance.sendOneWay(reply, message.getFrom()); if ( isMoveable_.get() ) { ...
public void doVerb(Message message) { Message reply = message.getInternalReply(new byte[] {(byte)(isMoveable_.get() ? 1 : 0)}); MessagingService.instance.sendOneWay(reply, message.getFrom()); if ( isMoveable_.get() ) { // MoveMessage moveMe...
public void load(String dir, File configFile ) throws ParserConfigurationException, IOException, SAXException { this.configFile = configFile; this.loader = new SolrResourceLoader(dir); FileInputStream cfgis = new FileInputStream(configFile); try { Config cfg = new Config(loader, null, cfgis, nul...
public void load(String dir, File configFile ) throws ParserConfigurationException, IOException, SAXException { this.configFile = configFile; this.loader = new SolrResourceLoader(dir); FileInputStream cfgis = new FileInputStream(configFile); try { Config cfg = new Config(loader, null, cfgis, nul...
public static Test suite() { TestSuite suite = new TestSuite("LargeDataLocksTest"); suite.addTest(baseSuite("LargeDataLocksTest:embedded")); // Disable for client until DERBY-2892 is fixed //suite.addTest(TestConfiguration.clientServerDecorator(baseSuite("LargeDataLocksTest:client"))...
public static Test suite() { TestSuite suite = new TestSuite("LargeDataLocksTest"); suite.addTest(baseSuite("LargeDataLocksTest:embedded")); // Disable for client until DERBY-2892 is fixed suite.addTest(TestConfiguration.clientServerDecorator(baseSuite("LargeDataLocksTest:client")));...
public void baseUIMAAnalyzerIntegrationTest() throws Exception { Directory dir = new RAMDirectory(); IndexWriter writer = new IndexWriter(dir, new IndexWriterConfig(Version.LUCENE_40, analyzer)); // add the first doc Document doc = new Document(); String dummyTitle = "this is a dummy title "; ...
public void baseUIMAAnalyzerIntegrationTest() throws Exception { Directory dir = new RAMDirectory(); IndexWriter writer = new IndexWriter(dir, new IndexWriterConfig(Version.LUCENE_50, analyzer)); // add the first doc Document doc = new Document(); String dummyTitle = "this is a dummy title "; ...
public static final void writeHTMLHeaderPartTwo(PrintWriter out, Collection<String> errorMessages) { out.println(" <body class=\"soria\">"); out .println(" <TABLE width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">"); out.println(" <TR width=\"100%\">"); out.println(" <TD id=\"cell-0-0\" colspan...
public static final void writeHTMLHeaderPartTwo(PrintWriter out, Collection<String> errorMessages) { out.println(" <body class=\"soria\">"); out .println(" <TABLE width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">"); out.println(" <TR width=\"100%\">"); out.println(" <TD id=\"cell-0-0\" colspan...
public SysInfoLog() { } // Write out sysinfo for a suite or test public void exec(String jvmName, String javaCmd, String classpath, String framework, PrintWriter pw, boolean useprocess) throws Exception { if ( useprocess == true ) { // Create a process t...
public SysInfoLog() { } // Write out sysinfo for a suite or test public void exec(String jvmName, String javaCmd, String classpath, String framework, PrintWriter pw, boolean useprocess) throws Exception { if ( useprocess == true ) { // Create a process t...
public void useExistingCollation(TableDescriptor td) throws StandardException { ColumnDescriptor cd; // First verify that the column exists cd = td.getColumnDescriptor(name); if (cd == null) { throw StandardException.newException(SQLState.LANG_COLUMN_NOT_FOUND_IN_TABLE, name, td.getName()); } ...
public void useExistingCollation(TableDescriptor td) throws StandardException { ColumnDescriptor cd; // First verify that the column exists cd = td.getColumnDescriptor(name); if (cd == null) { throw StandardException.newException(SQLState.LANG_COLUMN_NOT_FOUND_IN_TABLE, name, td.getName()); } ...
private final int appendPostings(SegmentMergeInfo[] smis, int n) throws IOException { int lastDoc = 0; int df = 0; // number of docs w/ term resetSkip(); for (int i = 0; i < n; i++) { SegmentMergeInfo smi = smis[i]; TermPositions postings = smi.getPositions(); int bas...
private final int appendPostings(SegmentMergeInfo[] smis, int n) throws IOException { int lastDoc = 0; int df = 0; // number of docs w/ term resetSkip(); for (int i = 0; i < n; i++) { SegmentMergeInfo smi = smis[i]; TermPositions postings = smi.getPositions(); int bas...
public SimpleTextFieldsWriter(SegmentWriteState state) throws IOException { final String fileName = SimpleTextCodec.getPostingsFileName(state.segmentName); out = state.directory.createOutput(fileName); state.flushedFiles.add(fileName); }
public SimpleTextFieldsWriter(SegmentWriteState state) throws IOException { final String fileName = SimpleTextCodec.getPostingsFileName(state.segmentName, state.codecId); out = state.directory.createOutput(fileName); state.flushedFiles.add(fileName); }
public PrefixCodedTermsWriter( TermsIndexWriterBase termsIndexWriter, SegmentWriteState state, PostingsWriterBase postingsWriter, Comparator<BytesRef> termComp) throws IOException { final String termsFileName = IndexFileNames.segmentFileName(state.segmentName, "", TERMS_EXTENSION); t...
public PrefixCodedTermsWriter( TermsIndexWriterBase termsIndexWriter, SegmentWriteState state, PostingsWriterBase postingsWriter, Comparator<BytesRef> termComp) throws IOException { final String termsFileName = IndexFileNames.segmentFileName(state.segmentName, state.codecId, TERMS_EXTENS...
public FixedGapTermsIndexWriter(SegmentWriteState state) throws IOException { final String indexFileName = IndexFileNames.segmentFileName(state.segmentName, "", TERMS_INDEX_EXTENSION); state.flushedFiles.add(indexFileName); termIndexInterval = state.termIndexInterval; out = state.directory.createOutpu...
public FixedGapTermsIndexWriter(SegmentWriteState state) throws IOException { final String indexFileName = IndexFileNames.segmentFileName(state.segmentName, state.codecId, TERMS_INDEX_EXTENSION); state.flushedFiles.add(indexFileName); termIndexInterval = state.termIndexInterval; out = state.directory....
public void reload(String name) { try { name = checkDefault(name); SolrCore core = solrCores.getCoreFromAnyList(name, false); if (core == null) throw new SolrException( SolrException.ErrorCode.BAD_REQUEST, "No such core: " + name ); try { solrCores.waitAddPendingCoreOps(n...
public void reload(String name) { try { name = checkDefault(name); SolrCore core = solrCores.getCoreFromAnyList(name, false); if (core == null) throw new SolrException( SolrException.ErrorCode.BAD_REQUEST, "No such core: " + name ); try { solrCores.waitAddPendingCoreOps(n...
private static final String[] JDBCAPI_TESTS_BOTH = { // from old jdbc20.runall "connectionJdbc20", // "statementJdbc20", runs in embedded only "resultsetJdbc20", // from old jdbcapi.runall "derbyStress", ...
private static final String[] JDBCAPI_TESTS_BOTH = { // from old jdbc20.runall "connectionJdbc20", // "statementJdbc20", runs in embedded only "resultsetJdbc20", // from old jdbcapi.runall // "derbyStress", TOD...
private void checkForIllegalConfig() throws IOException { // Do sanity checks - we don't want to find old style config failIfFound("solr/@coreLoadThreads"); failIfFound("solr/@persist"); failIfFound("solr/@sharedLib"); failIfFound("solr/@zkHost"); failIfFound("solr/logging/@class"); ...
private void checkForIllegalConfig() throws IOException { // Do sanity checks - we don't want to find old style config failIfFound("solr/@coreLoadThreads"); failIfFound("solr/@persistent"); failIfFound("solr/@sharedLib"); failIfFound("solr/@zkHost"); failIfFound("solr/logging/@class"...
public void testProperties() throws Exception { UpdateRequest up = new UpdateRequest(); up.setAction(ACTION.COMMIT, true, true); up.deleteByQuery("*:*"); up.process(getSolrCore0()); up.process(getSolrCore1()); up.clear(); // Add something to each core SolrInputDocument doc = new SolrI...
public void testProperties() throws Exception { UpdateRequest up = new UpdateRequest(); up.setAction(ACTION.COMMIT, true, true); up.deleteByQuery("*:*"); up.process(getSolrCore0()); up.process(getSolrCore1()); up.clear(); // Add something to each core SolrInputDocument doc = new SolrI...
public void doTest() throws Exception { boolean testsSuccesful = false; try { handle.clear(); handle.put("QTime", SKIPVAL); handle.put("timestamp", SKIPVAL); ZkStateReader zkStateReader = cloudClient.getZkStateReader(); // make sure we have leaders for each shard for (int j...
public void doTest() throws Exception { boolean testsSuccesful = false; try { handle.clear(); handle.put("QTime", SKIPVAL); handle.put("timestamp", SKIPVAL); ZkStateReader zkStateReader = cloudClient.getZkStateReader(); // make sure we have leaders for each shard for (int j...
public synchronized Object call() throws Exception { if (reference == null) { throw new ServiceUnavailableException("Service is unavailable", getOsgiFilter()); } if (service == null) { service = getBundleContextForServiceLookup().getService(ref...
public synchronized Object call() throws Exception { if (reference == null) { throw new ServiceUnavailableException("Service is unavailable", getOsgiFilter()); } if (service == null) { service = getServiceSecurely(reference); } ...
public void testCompare(UUID u1, UUID u2, int expC) { int c = sign(uuidType.compare(bytebuffer(u1), bytebuffer(u2))); expC = sign(expC); assertEquals("Expected " + describeCompare(u1, u2, expC) + ", got " + describeCompare(u1, u2, c), expC, c); if (u1.version() =...
public void testCompare(UUID u1, UUID u2, int expC) { int c = sign(uuidType.compare(bytebuffer(u1), bytebuffer(u2))); expC = sign(expC); assertEquals("Expected " + describeCompare(u1, u2, expC) + ", got " + describeCompare(u1, u2, c), expC, c); if (u1.version() =...
public void processFields(final Fieldable[] fields, final int count) throws IOException { fieldState.reset(docState.doc.getBoost()); final int maxFieldLength = docState.maxFieldLength; final boolean doInvert = consumer.start(fields, count); for(int i=0;i<count;i++) { ...
public void processFields(final Fieldable[] fields, final int count) throws IOException { fieldState.reset(docState.doc.getBoost()); final int maxFieldLength = docState.maxFieldLength; final boolean doInvert = consumer.start(fields, count); for(int i=0;i<count;i++) { ...
private final IndexReader doOpenFromWriter(boolean openReadOnly, IndexCommit commit) throws CorruptIndexException, IOException { assert readOnly; if (!openReadOnly) { throw new IllegalArgumentException("a reader obtained from IndexWriter.getReader() can only be reopened with openReadOnly=true (got fals...
private final IndexReader doOpenFromWriter(boolean openReadOnly, IndexCommit commit) throws CorruptIndexException, IOException { assert readOnly; if (!openReadOnly) { throw new IllegalArgumentException("a reader obtained from IndexWriter.getReader() can only be reopened with openReadOnly=true (got fals...
private void testRandomSeeks(IndexReader r, String... validTermStrings) throws IOException { final BytesRef[] validTerms = new BytesRef[validTermStrings.length]; for(int termIDX=0;termIDX<validTermStrings.length;termIDX++) { validTerms[termIDX] = new BytesRef(validTermStrings[termIDX]); } Arrays...
private void testRandomSeeks(IndexReader r, String... validTermStrings) throws IOException { final BytesRef[] validTerms = new BytesRef[validTermStrings.length]; for(int termIDX=0;termIDX<validTermStrings.length;termIDX++) { validTerms[termIDX] = new BytesRef(validTermStrings[termIDX]); } Arrays...
public static SortField getStringSortField(String fieldName, boolean reverse, boolean nullLast, boolean nullFirst) { if (nullLast) { if (!reverse) return new SortField(fieldName, nullStringLastComparatorSource); else return new SortField(fieldName, SortField.STRING, true); } else if (nullFirst) { ...
public static SortField getStringSortField(String fieldName, boolean reverse, boolean nullLast, boolean nullFirst) { if (nullLast) { if (!reverse) return new SortField(fieldName, nullStringLastComparatorSource); else return new SortField(fieldName, SortField.STRING, true); } else if (nullFirst) { ...
public LoopingAlphabetReader(long length, CharAlphabet alphabet, int trailingBlanks) { this.length = length; this.trailingBlanks = trailingBlanks; this.remainingNonBlanks = length - trailingBlanks; this.remainingBlanks...
public LoopingAlphabetReader(long length, CharAlphabet alphabet, int trailingBlanks) { this.length = length; this.trailingBlanks = trailingBlanks; this.remainingNonBlanks = length - trailingBlanks; this.remainingBlanks...
public InputStream getBinaryStream(long pos, long length) throws SQLException { //call checkValidity to exit by throwing a SQLException if //the Blob object has been freed by calling free() on it checkValidity(); if (pos <= 0) { throw Util.generateCsSQLEx...
public InputStream getBinaryStream(long pos, long length) throws SQLException { //call checkValidity to exit by throwing a SQLException if //the Blob object has been freed by calling free() on it checkValidity(); if (pos <= 0) { throw Util.generateCsSQLEx...
public java.io.Reader getCharacterStream(long pos, long length) throws SQLException { //call checkValidity to exit by throwing a SQLException if //the Clob object has been freed by calling free() on it checkValidity(); if (pos <= 0) { throw Util.generateC...
public java.io.Reader getCharacterStream(long pos, long length) throws SQLException { //call checkValidity to exit by throwing a SQLException if //the Clob object has been freed by calling free() on it checkValidity(); if (pos <= 0) { throw Util.generateC...
protected void testCompaction(int sstableCount, int rowsPerSSTable, int colsPerRow) throws Exception { CompactionManager.instance.disableAutoCompaction(); Table table = Table.open(TABLE1); ColumnFamilyStore store = table.getColumnFamilyStore("Standard1"); ArrayList<SSTableReade...
protected void testCompaction(int sstableCount, int rowsPerSSTable, int colsPerRow) throws Exception { CompactionManager.instance.disableAutoCompaction(); Table table = Table.open(TABLE1); ColumnFamilyStore store = table.getColumnFamilyStore("Standard1"); ArrayList<SSTableReade...
public void testIndexCreate() throws IOException, ConfigurationException, InterruptedException { Table table = Table.open("Keyspace1"); // create a row and update the birthdate value, test that the index query fetches the new version RowMutation rm; rm = new RowMutation("Keyspac...
public void testIndexCreate() throws IOException, ConfigurationException, InterruptedException { Table table = Table.open("Keyspace1"); // create a row and update the birthdate value, test that the index query fetches the new version RowMutation rm; rm = new RowMutation("Keyspac...
private static boolean randomlyReadRepair(ReadCommand command) { CFMetaData cfmd = DatabaseDescriptor.getTableMetaData(command.table).get(command.getColumnFamilyName()); return cfmd.readRepairChance > random.nextDouble(); }
private static boolean randomlyReadRepair(ReadCommand command) { CFMetaData cfmd = DatabaseDescriptor.getTableMetaData(command.table).get(command.getColumnFamilyName()); return cfmd.getReadRepairChance() > random.nextDouble(); }
public MergeSpecification findMerges(SegmentInfos infos) throws IOException { final int numSegments = infos.size(); if (verbose()) message("findMerges: " + numSegments + " segments"); // Compute levels, which is just log (base mergeFactor) // of the size of each segment float[] levels = ne...
public MergeSpecification findMerges(SegmentInfos infos) throws IOException { final int numSegments = infos.size(); if (verbose()) message("findMerges: " + numSegments + " segments"); // Compute levels, which is just log (base mergeFactor) // of the size of each segment float[] levels = ne...
public String toString(String f) { StringBuffer buffer = new StringBuffer(); if (!field.equals(f)) { buffer.append(field); buffer.append(":"); } buffer.append("\""); for (int i = 0; i < terms.size(); i++) { buffer.append(((Term)terms.get(i)).text()); if (i != terms.size()-...
public String toString(String f) { StringBuffer buffer = new StringBuffer(); if (field != null && !field.equals(f)) { buffer.append(field); buffer.append(":"); } buffer.append("\""); for (int i = 0; i < terms.size(); i++) { buffer.append(((Term)terms.get(i)).text()); if (i...
private List createRandomSample(final Map rows, int k) { Random r = new Random(); ArrayList sampledKeys = new ArrayList(); int n = 0; for (Iterator i = rows.keySet().iterator(); i.hasNext();) { Object key = i.next(); n++; if (n<...
private List createRandomSample(final Map rows, int k) { Random r = new Random(); ArrayList sampledKeys = new ArrayList(); int n = 0; for (Iterator i = rows.keySet().iterator(); i.hasNext();) { Object key = i.next(); n++; if (n<...
public IValidator getValidator(String table, String cf, InetAddress initiator, boolean major) { if (!major || table.equals(Table.SYSTEM_TABLE) || table.equals(Table.DEFINITIONS)) return new NoopValidator(); if (StorageService.instance.getTokenMetadata().sortedTokens().size() < 1) ...
public IValidator getValidator(String table, String cf, InetAddress initiator, boolean major) { if (!major || table.equals(Table.SYSTEM_TABLE)) return new NoopValidator(); if (StorageService.instance.getTokenMetadata().sortedTokens().size() < 1) // gossiper isn't started...
public 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 MockAnalyzer()) .setMaxBufferedDocs(2).setMergedSegm...
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 MockAnalyzer()) .setMaxBufferedDocs(2).setMergedSegm...
public void writeRequest(OutputStream out) throws IOException { try { OutputStreamWriter writer = new OutputStreamWriter( out ); writer.append( "<stream>" ); // can be anything... UpdateRequest req = queue.poll( 250, TimeUnit.MILLISECONDS ); ...
public void writeRequest(OutputStream out) throws IOException { try { OutputStreamWriter writer = new OutputStreamWriter(out, "UTF-8"); writer.append( "<stream>" ); // can be anything... UpdateRequest req = queue.poll( 250, TimeUnit.MILLISECONDS ); ...
public ViewFragment markReferenced(DecoratedKey startWith, DecoratedKey stopAt) { DataTracker.View view; List<SSTableReader> sstables; while (true) { view = data.getView(); // startAt == minimum is ok, but stopAt == minimum is confusing because all Interva...
public ViewFragment markReferenced(DecoratedKey startWith, DecoratedKey stopAt) { DataTracker.View view; List<SSTableReader> sstables; while (true) { view = data.getView(); // startAt == minimum is ok, but stopAt == minimum is confusing because all Interva...
public void setUp() throws Exception { super.setUp(); int retries = 5; for (int i = 0; i < retries; i++) { try { ServerSocket server = new ServerSocket(0); try { port = server.getLocalPort(); } finally { server.close(); } // System.out.prin...
public void setUp() throws Exception { super.setUp(); int retries = 5; for (int i = 0; i < retries; i++) { try { ServerSocket server = new ServerSocket(0); try { port = server.getLocalPort(); } finally { server.close(); } // System.out.prin...
public void listenToUnitOfWork() { if (!listenToUnitOfWork_) { listenToUnitOfWork_ = true; connection_.CommitAndRollbackListeners_.add(this); } }
public void listenToUnitOfWork() { if (!listenToUnitOfWork_) { listenToUnitOfWork_ = true; connection_.CommitAndRollbackListeners_.put(this,null); } }
public void listenToUnitOfWork() { agent_.connection_.CommitAndRollbackListeners_.add(this); }
public void listenToUnitOfWork() { agent_.connection_.CommitAndRollbackListeners_.put(this,null); }
private void handleDeleteAliasAction(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception { log.info("Delete alias action : " + req.getParamString()); String name = req.getParams().required().get("name"); ZkNodeProps m = new ZkNodeProps(Overseer.QUEUE_OPERATION, OverseerCollect...
private void handleDeleteAliasAction(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception { log.info("Delete alias action : " + req.getParamString()); String name = req.getParams().required().get("name"); ZkNodeProps m = new ZkNodeProps(Overseer.QUEUE_OPERATION, OverseerCollect...
public void openCore() throws StandardException { TransactionController tc; beginTime = getCurrentTimeMillis(); if (SanityManager.DEBUG) SanityManager.ASSERT( ! isOpen, "HashScanResultSet already open"); // Get the current transaction controller tc = activation.getTransactionControlle...
public void openCore() throws StandardException { TransactionController tc; beginTime = getCurrentTimeMillis(); if (SanityManager.DEBUG) SanityManager.ASSERT( ! isOpen, "HashScanResultSet already open"); // Get the current transaction controller tc = activation.getTransactionControlle...
public static Query createJoinQuery(String fromField, boolean multipleValuesPerDocument, String toField, Query fromQuery, IndexSearcher fromSearcher, ...
public static Query createJoinQuery(String fromField, boolean multipleValuesPerDocument, String toField, Query fromQuery, IndexSearcher fromSearcher, ...
protected String generateConfig() { String thirdLocaleParam = random().nextBoolean() ? "" : (", '" + Locale.getDefault() + "'"); StringBuilder sb = new StringBuilder(); sb.append("<dataConfig> \n"); sb.append("<dataSource name=\"hsqldb\" driver=\"org.hsqldb.jdbcDriver\" url=\"jdbc:hsqldb:mem:.\" /> \n...
protected String generateConfig() { String thirdLocaleParam = random().nextBoolean() ? "" : (", '" + Locale.getDefault() + "'"); StringBuilder sb = new StringBuilder(); sb.append("<dataConfig> \n"); sb.append("<dataSource name=\"hsqldb\" driver=\"${dataimporter.request.dots.in.hsqldb.driver}\" url=\"j...
private VariableResolver getVariableResolver() { try { VariableResolver resolver = null; if(dataImporter != null && dataImporter.getCore() != null && dataImporter.getCore().getResourceLoader().getCoreProperties() != null){ resolver = new VariableResolver(dataImporter.getCore().getRe...
private VariableResolver getVariableResolver() { try { VariableResolver resolver = null; if(dataImporter != null && dataImporter.getCore() != null && dataImporter.getCore().getResourceLoader().getCoreProperties() != null){ resolver = new VariableResolver(dataImporter.getCore().getRe...
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 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 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 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(...