Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

SMILA/Documentation/Management

< SMILA‎ | Documentation
Revision as of 06:56, 20 March 2009 by Eliseyev.softaria.com (Talk | contribs) (Crawlers performance counters)

SMILA is a framework with a lot of functionality. Most is invoke automatically by internal operations. Nevertheless, the user has to configure and start an initial operation. All functions a user can execute are accessible from the JMX Management Agent. On the following pages you will learn how to use SMILA with the aid of Java's built in JConsole and to handle the JMXClient which features access to SMILA commands via batch files.

Management with the aid of jconsole

The jconsole is a little tool for monitoring java applications nested in the JDK. Over a JMX connection it’s possible to connect an application with the swing UI of jconsole. If you start up SMILA engine and open jconsole you can connect the Jconsole to SMILA immediately.

jconsole

After connecting you can find SMILA operation on MBeans tab in the Tree on the left site.

Smila manageable Components

There are four components of SMILA which you can access over jconsole.

CrawlerController

Here you can manage the crawling jobs. The following commands are available:

  • startCrawl(String dataSourceID): starts a crawling job with the given dataSourceID, for example file or web.
  • stopCrawl(String dataSourceID): stops the crawling job for the given dataSourceID. Note: the crawler is only signaled to stop and may do so at its own discretion. In other words: depending on the implementation it might take a while until it actually stops crawling. It thus gives the crawler the chance to clean up all open resources and finish whatever business it needs to.
  • getActiveCrawls(): opens a dialog which show a list containing the dataSourceID for all active crawl jobs. If no job is running the dialog shows null.
  • getActiveCrawlsStatus(): opens a dialog telling you how many crawl jobs are active at the moment.
  • getStatus(String dataSourceID): opens a dialog which shows you the status of the crawling job for a given dataSoruceID. Possible states are: RUNNING, FINISHED, STOPPED or ABORTED.

RecordRecycler

The RecordRecycler gives you the possibly to push already crawled records into Data Flow Process again. For example it could be useful if you want to modify record in the index with another pipeline. To control RecordRecycler there are following operations available.

  • startRecycling(String configurationID, String dataSourceId): fires a recycling event with the given configurationID ( the configurationID must match the name of a configuration file located at configuration/org.eclipse.smila.connectivity.framework.queue.worker/recyclers) and dataSourceID (get records from RecordStorage which have this dataSourceID). See QueueWorker documentation for further enlightenment on the Recycler.
  • stopRecycling(String dataSourceID): stops the recycle event for the given dataSourceID.
  • getRecordsRecycled(String dataSourceID): opens a dialog shows how many records are recycled.
  • getConfigurations(String dataSourceID): show a list containing all available recycle configuration files.
  • getStatus(String dataSourceID): open dialog showing the status of recycling event for given dataSourceID. Possible states are: STARTED, IN_PROCESS, STOPPING, STOPPED, FINISHED.

DeltaIndexingManager

The DeltaIndexManager stores a hash value of each record. It is part of the Connectivity Framework and signals a crawler that a given record has (not) changed since the last crawl. See DeltaIndexing documentation. Within jconsole you can use the following commands:

  • clearAll(): clears all hashes thus enabling to reprocess all records
  • unlockAll(): unlock all datasources
  • clear(String dataSourceID): same as clearAll but limited to one data source

Lucene

With Lucene you have the possibility to invoke several method concerning the index. Following operation are available:

  • deleteIndex(String indexName): removes the index with the given name if available. Otherwise an error dialog is shown.
  • indexExists(String indexName): ask the framework if the given Index exists. Returns true or false.
  • createIndex (String indexName): creates an index with the given name.
  • reorganizeIndex(String indexName): reorganizes the index with the given name. This will clean up the index, in that deleted entries are physically removed resulting in a smaller index size.
  • renameIndex(String currentIndexName, String newIndexName): rename the index with the given name (currentIndexname) into the value of newIndexName.

PerformanceCounter

A PerformanceCounter monitors the activity of a component. In SMILA actually are two kinds of PerformanceCounters available, one for Crawlers and another for Processing within the Data Flow Process. With the aid of jconsole you have the possibility to look at interesting counters of SMILA. There exist a lot of views that allow you to get information about different situations.

Crawlers performance counters

After you start a crawl job immediately a new branch in MBeans-tree appears with the following nodes/values:

Crawler counters tree
  • Crawlers
    • FileSystem - Crawler type
      • Launches
        • file - Data source Id
          • 19786841 - Crawler instance, one node for every crawl job
      • Total - Crawler type sub-total
    • Web - Crawler type
      • Launches
        • web - Data source Id
          • 2611152 - Crawler instance, one node for every crawl job
      • Total - Crawler type sub-total
    • Total

The nodes contain a subset collection of these possible counters:

  • AttachmentBytesTransfered: total records attachment bytes transfered
  • AttachmentTransferRate: overall (whole crawl job) records attachment bytes transfer rate (bytes/millisec)
  • AverageAttachmentTransferRate: records attachment bytes transfer rate (bytes/millisec)
  • AverageDeltaIndicesProcessingTime: average delta index processing time (milisec)
  • AverageRecordsProcessingTime: average record processing time (milisec)
  • OverallAverageDeltaIndicesProcessingTime: overall delta index processing time (milisec)
  • OverallAverageRecordsProcessingTime: overall record processing time (milisec)
  • Error: contains a collection of all errors occurred. On operation tab you can find a method to show all errors in a dialog box.
  • Delta-indices: number of delta indices created in LuceneIndex.
  • Exceptions(critical): number of critical exceptions.
  • Exceptions(non-critical): number of non-critical exceptions.
  • Exceptions(producer): number of producer exceptions.
  • Files: number of files which were crawled. (only FileSystemCrawler)
  • Folder: number of folder walked through. (only FileSystemCrawler)
  • Records: number of records created.
  • Bytes: how much bytes were downloaded
  • http-fetch-time: average of each http-fetch-time (how much time it costs to download webpage.
  • Pages: how many pages were visited.

Processing performance counters

As soon as Router puts Records into MQ the Listener pushes them into Data Flow Process. This time a new section with the following hierarchy (only an example, because PerformanceCounters vary according to your personal usage of SMILA) appears in MBeans-tree:

  • Pipeline: lists all invoked pipelines.
    • AddPipeline
    • DeletePipeline
  • Processing Service: lists all processing services which were invoked, sorted by pipelines
    • AddPipeline
      • LuceneIndexService
      • SimepleMimeTypeIdentifier
    • DeletePipeline
      • LuceneIndexService
  • Simple Pipelet: lists all pipelets which were used, sorted by pipelines
    • AddPipeline
      • HtmlToTextPipelet

JMX Client

The JMX Client is a lightweight and very easy to use command line driven component to use access most JMX Management operations. It works without jconsole and provides only a few commands. If you want to have full control over SMILA framework you have to use jconsole as described in the chapter above. But if you only want to start a crawl job or check if a crawl job is still active, you don’t have to use the jconsole. Furthermore you have the possibility to expand functionality of JMX Client. It is highly configurable with only one single configuration file.

Pre-defined commands (batch-files)

  • crawlFILE: start a crawl job with the file-dataSoruceID
  • crawlFILEandWait: same as command above with the exception that the console-window stays open till the crawl job has finished.
  • crawlFILEstop: stop the crawl job for dataSoruceID file, if one is active.
  • crawlWEB: start a crawl job with web dataSourceID.
  • crawlWEBandWait: same as command above with the exception that the console-windows stays open till the crawl job has finished.
  • crawlWEBstop: stop the crawl job for dataSoruceID web, if one is active.
  • getActiveCrawls: show all active crawl jobs on console.
  • indexOptimize: invoke a reorganize of LuceneIndex (default test_index).
  • recycleConfigurations: display all available recycler configurations.
  • recycleFILE: start a recycle event for dataSoruceID file and the default recyclerConfig (recycler1.xml)
  • recycleFILEandWait: same as command above with the exception that the console-window stays open till the recycle event has finished.
  • recycleFILEstatus: show the actual status of recycle event for dataSourceID file.

Usage

If you open command window in folder SMILA/jmxclient and execute run.bat you'll get very useful help.

JMX Client

The JMX Client can be used to simplify JMX Management while using batch-files for most important functions. But that’s not all. With the aid of JMX Client you have the possibility to use SMILA completely from your console or write own batch files which could invoke for example one method after another. The Client works with commands. These commands are managed in only one configuration file. In addition to the pre-defined commands you are able to create own commands. You only need to know the fully qualified class name and method name of function you want to invoke. To execute a command simply use this pattern: run.bat commandName commandParameters. The JMX client is able to execute any JMX operation and get any JMX attribute and to make it in one batch with reusing previous results.

Configuration

There is a configuration file located at org.eclipse.smila.management.jmx.client/schemas/jmxclient.xsd (Soruce) and jmxclient/schemas/jmxclient.xsd (Build). The default configuration file could be found at org.eclipse.smila.management.jmx.client/config.xml (Source) and jmxclient/config.xml.

Default configuration

<jmxclient xmlns="http://www.eclipse.org/smila/management/jmx/client" xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance
  xsi:noNamespaceSchemaLocation="schemas/jmxclient.xsd"
>
  <connection id="local" host="localhost" port="9004"/>
  <connection id="test" host="10.0.0.1" port="23123"/>
  <!-- crawler controller related operations -->
  <cmd id="crawl" echo="Starting crawler by datasource id">
    <operation
      domain="SMILA"
      key="org.eclipse.smila.connectivity.framework.CrawlerController"
      name="startCrawl"
      echo="Starting crawl [%1]"
    >
      <parameter echo="data source id"/>
    </operation>
  </cmd>
  <cmd id="crawlStop" echo="Stop crawler by datasource id">
    <operation
      domain="SMILA"
      key="org.eclipse.smila.connectivity.framework.CrawlerController"
      name="stopCrawl"
      echo="Stopping crawl [%1]"
    >
      <parameter echo="data source id"/>
    </operation>
  </cmd>
  <cmd id="crawlW" echo="Starting crawler by datasource id and wait for finished">
    <operation
      domain="SMILA"
      key="org.eclipse.smila.connectivity.framework.CrawlerController"
      name="startCrawl"
      echo="Starting crawl [%1]"
    >
      <parameter echo="data source id"/>
    </operation>
    <!-- result will be similar to "Crawl with the dataSourceId = file and hashcode [595826] successfully started!"
         we have to extract hashcode from string -->
    <regexp pattern="^.*\[(\d+)\].*$" group="1" echo="Extracting crawler hash code"/>
    <wait echo="Waiting while crawl ends" pause="1000">
      <in>
        <cmd id="-" echo="Getting crawler status by datasource id">
          <operation
            domain="SMILA"
            key="org.eclipse.smila.connectivity.framework.CrawlerController"
            name="getStatus"
            echo="Crawl [%1] status"
          >
            <!--  value="%1" -->
            <parameter echo="data source id"/>
          </operation>
        </cmd>
        <const value="Finished" echo="Crawling finished status"/>
        <const value="Stopped" echo="Crawling stopped status"/>
      </in>
      <cmd id="-" echo="Reading crawler performance counters">
        <attribute
          domain="SMILA Crawlers"
          key="Crawlers,crawler=%2,name=Total,counter=records"
          name="Value"
          echo="Total records"
        />
        <attribute
          domain="SMILA Crawlers"
          key="Crawlers,crawler=%2,name=Instances,hash=%0,counter=records"
          name="Value"
          echo="Instance records"
        />
        <attribute
          domain="SMILA Crawlers"
          key="Crawlers,crawler=%2,name=Instances,hash=%0,buffer=Errors"
          name="Errors"
          echo="Errors"
        />
      </cmd>
    </wait>
  </cmd>
  <cmd id="activeCrawls" echo="Reading active crawls">
    <attribute
      domain="SMILA"
      key="org.eclipse.smila.connectivity.framework.CrawlerController"
      name="ActiveCrawls"
      echo="Active crawls"
    />
  </cmd>  
  <!-- record recycler related operations -->
  <cmd id="recycle" echo="Starting recycler by configuration name and datasource id">
    <operation
      domain="SMILA"
      key="org.eclipse.smila.connectivity.queue.worker.RecordRecycler"
      name="startRecycle"
      echo="Starting recycle by configuration [%1] and data source [%2]"
    >
      <parameter echo="configuration file name"/>
      <parameter echo="data source id"/>
    </operation>
  </cmd>
  <cmd id="recycleStatus" echo="Get recycler status by datasource id">
    <operation
      domain="SMILA"
      key="org.eclipse.smila.connectivity.queue.worker.RecordRecycler"
      name="getStatus"
      echo="Getting recycling status for data source [%1]"
    >
      <parameter echo="data source id"/>
    </operation>
  </cmd>
  <cmd id="recycleStop" echo="Stopping recycler by datasource id">
    <operation
      domain="SMILA"
      key="org.eclipse.smila.connectivity.queue.worker.RecordRecycler"
      name="stopRecycle"
      echo="Stopping recycle by data source [%1]"
    >
      <parameter echo="data source id"/>
    </operation>
  </cmd>
  <cmd id="recycleConfigs" echo="Getting recycler configurations list">
    <attribute
      domain="SMILA"
      key="org.eclipse.smila.connectivity.queue.worker.RecordRecycler"
      name="Configurations"
      echo="Getting recycler configurations list"
    />
  </cmd>
  <cmd id="recycleW" echo="Starting recycler by configuration name and datasource id and wait for finished">
    <operation
      domain="SMILA"
      key="org.eclipse.smila.connectivity.queue.worker.RecordRecycler"
      name="startRecycle"
      echo="Starting recycle by configuration [%1] and data source [%2]"
    >
      <parameter echo="configuration file name"/>
      <parameter echo="data source id"/>
    </operation>
    <wait echo="Waiting while recycing ends" pause="1000">
      <in>
        <cmd id="-" echo="Getting crawler status by datasource id">
          <operation
            domain="SMILA"
            key="org.eclipse.smila.connectivity.queue.worker.RecordRecycler"
            name="getStatus"
            echo="Recycling status"
          >
            <parameter echo="data source id" argument="2"/>
          </operation>
        </cmd>
        <const value="FINISHED" echo="Recycling finished status"/>
        <const value="STOPPED" echo="Recycling stopped status"/>
        <const value="EXCEPTION" echo="Recycling exception status"/>
      </in>
      <cmd id="-" echo="Reading recycler counters">
        <operation
          domain="SMILA"
          key="org.eclipse.smila.connectivity.queue.worker.RecordRecycler"
          name="getRecordsRecycled"
          echo="Records recycled"
        >
          <parameter echo="data source id" argument="2"/>
        </operation>
      </cmd>
    </wait>
  </cmd>
  <!-- Lucene index related operations -->  
  <cmd id="createIndex" echo="Create index by name">
    <operation
      domain="SMILA"
      key="org.eclipse.smila.lucene"
      name="createIndex"
      echo="Creating index [%1]"
    >
      <parameter echo="index name"/>
    </operation>
  </cmd>
  <cmd id="reorganizeIndex" echo="Optimize index by name">
    <operation
      domain="SMILA"
      key="org.eclipse.smila.lucene"
      name="reorganizeIndex"
      echo="Optimizing index [%1]"
      voidType="true"
    >
      <parameter echo="index name"/>
    </operation>
  </cmd>
  <cmd id="deleteIndex" echo="Delete index by name">
    <operation
      domain="SMILA"
      key="org.eclipse.smila.lucene"
      name="deleteIndex"
      echo="Deleting index [%1]"
      voidType="true"
    >
      <parameter echo="index name"/>
    </operation>
  </cmd>
  <cmd id="isIndexExists" echo="Check is index exists by name">
    <operation
      domain="SMILA"
      key="org.eclipse.smila.lucene"
      name="isIndexExists"
      echo="Checking index [%1]"
    >
      <parameter echo="index name"/>
    </operation>
  </cmd>
  <cmd id="renameIndex" echo="Rename index">
    <operation
      domain="SMILA"
      key="org.eclipse.smila.lucene"
      name="renameIndex"
      echo="Renaming index [%1] to [%2]"
      voidType="true"
    >
      <parameter echo="index name"/>
      <parameter echo="new index name"/>
    </operation>
  </cmd>
  <sample value="run crawl file" echo="starts filesystem crawler"/>
  <sample value="run crawlW file FilesystemCrawlerDS" echo="starts filesystem crawler and waits crawling end"/>
</jmxclient>

Configuration explanation

To use commands which interact with JMX a connection is needed
<connection id="local" host="localhost" port="9004"/>
To create your own command you have to use cmd command after this schema
  • cmd:
    • id: name of the command.
    • echo: something to display on console if command is execute.
      • operation
        • domain: JMX property root is DOMAIN inside each domain paths (to leafs) are identified by KEY for leafs there are operstions and attributes.
        • key: Class containing method.
        • name: name of the method to invoke.
        • echo: something to display on console if method is invoked.
          • parameter: one tag for each parameter.
            • echo: description for the parameter.
To keep the console open and inform you about actual status you can use the wait tag
  • STEP 1:
  <operation
    domain="SMILA"
    key="org.eclipse.smila.connectivity.framework.CrawlerController"
    name="startCrawl"
    echo="Starting crawl [%1]">
     <parameter echo="data source id"/>
  </operation>
for DOMAIN "SMILA" and leaf identified by KEY „org.eclipse.smila.connectivity.framework.CrawlerController" execute operation "startCrawl" with one input parameter ( its String type - default) JMX will return result to client, e.g. "Crawl with the dataSourceId = file and hashcode [595826] successfully started!"
  • STEP 2:
we should extract hash code from crawler to track its activities it was used by task the next result is "595826"
  <regexp pattern="^.*\[(\d+)\].*$" group="1" echo="Extracting crawler hash code"/>
  • STEP 3 is a wait task - the most complex - we will wait until crawl finished here it defined by 2 subnodes
<wait echo="Waiting while crawl ends" pause="1000">
  <in>
    <cmd id="-" echo="Getting crawler status by datasource id">
      <operation
        domain="SMILA"
        key="org.eclipse.smila.connectivity.framework.CrawlerController"
        name="getStatus"
        echo="Crawl [%1] status">
          <parameter echo="data source id"/>
      </operation>
    </cmd>
    <const value="Finished" echo="Crawling finished status"/>
    <const value="Stopped" echo="Crawling stopped status"/>
  </in>
  <cmd id="-" echo="Reading crawler performance counters">
    <attribute
      domain="SMILA Crawlers"
      key="Crawlers,crawler=%2,name=Total,counter=records"
      name="Value"
      echo="Total records"
    />
    ...
  </cmd>
 </wait>
First subnode ( here its logical IN ) is a condition to exit from WAIT task. Second subnode is a batch to execute if we not exited. So each 1000 ms it will ask for status and validate is it IN "Finished" or "Stopped":
  • if it is, the crawling finished, otherwise:
  • three performance counters defined in cmd with id="-" will be printed.

External links

Back to the top