Examples of IndexDescriptor


Examples of com.flaptor.hounder.IndexDescriptor

            baseDir.mkdirs();
        }
    }

    public boolean addIndex(Index index) {
        IndexDescriptor desc = index.getIndexDescriptor();
        if (!knownClusters.contains(desc.getClusterName())) {
            return false;
        }

        // If there was an old copy of that index, delete it
        Index oldFromSameCluster = indexes.get(desc.getClusterName());
        if (null != oldFromSameCluster) {
            logger.debug("erasing old index for cluster \"" + desc.getClusterName() + "\".");
            oldFromSameCluster.eraseFromDisk();
        }


        // add it to current indexes
        indexes.put(desc.getClusterName(),index);

        // if we have a copy of each of this clusters, we can
        // create a multi index.
        if (indexes.size() == knownClusters.size()) {
            Index[] toMerge = new Index[knownClusters.size()];
View Full Code Here

Examples of com.flaptor.hounder.IndexDescriptor

                         + "indexes";
     
    lastOperation = new Hashtable<String, Long>();
        workingDirectory = new File(workingDirPath);
    indexDirectory = new File(workingDirectory, "index");
        indexDescriptor = new IndexDescriptor(config.getString("IndexManager.indexDescriptor"));
        library = new IndexLibrary(indexer);

        optimizeForBatch = config.getBoolean("optimizeForBatch");
        if (optimizeForBatch) {
            logger.warn("Constructor: the index manager is configured for batch indexing. Deletes will throw exceptions and"
View Full Code Here

Examples of com.flaptor.hounder.IndexDescriptor

            logger.info("constructor: Using latest copy as index.");
            String indexPath = indexDirectory.getAbsolutePath();
            com.flaptor.util.FileUtil.deleteDir(indexPath);
            Index latestCopyIndex = new Index(new File(latestCopy));
            workIndex = latestCopyIndex.copyIndex(indexDirectory);
            IndexDescriptor foundIndexDescriptor = workIndex.getIndexDescriptor();
            if (!indexDescriptor.equals(foundIndexDescriptor)) {
                String s = "This indexer is supposed to serve: " + indexDescriptor.toString() + ", but the index" +
                    " found is: " + foundIndexDescriptor.toString();
                logger.fatal(s);
                throw new IllegalStateException(s);
            }
            nextAddId = findLargestAddId() + 1;
            openWriter();
View Full Code Here

Examples of com.flaptor.hounder.IndexDescriptor

        this.clusterSize = clusterSize;
        this.outputDirectory = outputDirectory;
        hashFunction = new Hash(clusterSize);
        indexManagers = new BatchIndexManager[clusterSize];
        for (int i = 0; i < clusterSize; i++) {
            IndexDescriptor id = new IndexDescriptor(clusterSize, i , fragmentName);
            indexManagers[i] = new BatchIndexManager(id, new File(outputDirectory, "index-" + String.valueOf(i)));
        }
        //Some of the configuration is taken from the config system
        Config config = Config.getConfig("indexer.properties");
        docIdName = config.getString("docIdName");
View Full Code Here

Examples of com.flaptor.hounder.IndexDescriptor

                }
            }
            // Write index descriptors
            for (int i = 0; i < numIndexes; i++) {
                Index idx = new Index(new File(indexNames[i]));
                IndexDescriptor idxDescriptor = new IndexDescriptor(numIndexes,i,"defaultCluster");
                idx.setIndexDescriptor(idxDescriptor);
                idx.setIndexProperty("lastOptimization",String.valueOf(System.currentTimeMillis()));
                idx.close();
            }
           
View Full Code Here

Examples of com.flaptor.hounder.IndexDescriptor

    }


    public static void main(String[] args) throws Exception {
        IRemoteIndexUpdater updater = new IndexUpdatesListenerStub(Integer.parseInt(args[1]), args[0]);
        IndexDescriptor idxDesc = new IndexDescriptor("0of1@defaultCluster");
        if (args[2].contains(":")) {
            idxDesc.setRsyncAccessString(args[2].split(":")[0]);
            idxDesc.setLocalPath(args[2].split(":")[1]);
        } else {
            idxDesc.setRsyncAccessString("");
            idxDesc.setLocalPath(args[2]);
        }
        System.out.println("Updating " + idxDesc.getRemotePath() +" : " + updater.setNewIndex(idxDesc));
    }
View Full Code Here

Examples of org.apache.derby.catalog.IndexDescriptor

               * null in a join case (See Beetle 4423)
               */
              AccessPath accessPath= getTrulyTheBestAccessPath();
              if (accessPath == null)
                return;
              IndexDescriptor id = accessPath.
                        getConglomerateDescriptor().
                        getIndexDescriptor();
              int[] keyColumns = id.baseColumnPositions();
              boolean[] isAscending = id.isAscending();
              for (int i = 0; i < keyColumns.length; i++)
              {
                /* in such a query: select min(c3) from
                 * tab1 where c1 = 2 and c2 = 5, if prefix keys
                 * have equality operator, then we can still use
View Full Code Here

Examples of org.apache.derby.catalog.IndexDescriptor

              if (accessPath == null ||
                accessPath.getConglomerateDescriptor()==null||
                accessPath.getConglomerateDescriptor().
                           getIndexDescriptor() == null)
                return;
              IndexDescriptor id = accessPath.
                        getConglomerateDescriptor().
                        getIndexDescriptor();
              int[] keyColumns = id.baseColumnPositions();
              boolean[] isAscending = id.isAscending();
              for (int i = 0; i < keyColumns.length; i++)
              {
                /* in such a query: select min(c3) from
                 * tab1 where c1 = 2 and c2 = 5, if prefix keys
                 * have equality operator, then we can still use
View Full Code Here

Examples of org.apache.derby.catalog.IndexDescriptor

      if (! cd.isIndex())
      {
        continue;
      }
      IndexDescriptor id = cd.getIndexDescriptor();

      if (! id.isUnique())
      {
        continue;
      }

      int[] keyColumns = id.baseColumnPositions();
      int numBits = tableColMap[0].size();
      JBitSet keyMap = new JBitSet(numBits);
      JBitSet resMap = new JBitSet(numBits);

      int inner = 0;
View Full Code Here

Examples of org.apache.derby.catalog.IndexDescriptor

            if (step == 0 && baseColumnPositions[k + step] == 0)
              step++;
            newBCP[k] = baseColumnPositions[k + step];
            newIsAscending[k] = isAscending[k + step];
          }
          IndexDescriptor id = compressIRGs[j].getIndexDescriptor();
          id.setBaseColumnPositions(newBCP);
          id.setIsAscending(newIsAscending);
          id.setNumberOfOrderedColumns(id.numberOfOrderedColumns() - 1);
        }
      }
      compressIRGs = newIRGs;
      indexConglomerateNumbers = newIndexConglomNumbers;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.