org.pentaho.di.trans.steps.solrinput.SolrInputData.java Source code

Java tutorial

Introduction

Here is the source code for org.pentaho.di.trans.steps.solrinput.SolrInputData.java

Source

/*! ******************************************************************************
*
* Pentaho Data Integration
*
* Copyright (C) 2002-2013 by Pentaho : http://www.pentaho.com
*
*******************************************************************************
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************/

package org.pentaho.di.trans.steps.solrinput;

import org.pentaho.di.core.row.RowMetaInterface;
import org.pentaho.di.trans.step.BaseStepData;
import org.pentaho.di.trans.step.StepDataInterface;

import java.util.ArrayList;
import java.util.List;

import org.apache.solr.client.solrj.impl.HttpSolrServer;
import org.apache.solr.client.solrj.response.FacetField;
import org.apache.solr.common.SolrDocumentList;

/**
 * This class is part of the demo step plug-in implementation.
 * It demonstrates the basics of developing a plug-in step for PDI. 
 * 
 * The demo step adds a new string field to the row stream and sets its
 * value to "Hello World!". The user may select the name of the new field.
 *   
 * This class is the implementation of StepDataInterface.
 *   
 * Implementing classes inherit from BaseStepData, which implements the entire
 * interface completely. 
 * 
 * In addition classes implementing this interface usually keep track of
 * per-thread resources during step execution. Typical examples are:
 * result sets, temporary data, caching indexes, etc.
 *   
 * The implementation for the demo step stores the output row structure in 
 * the data class. 
 *   
 */
public class SolrInputData extends BaseStepData implements StepDataInterface {

    public RowMetaInterface outputRowMeta;
    public RowMetaInterface convertRowMeta;
    public int nrfields;
    public int recordIndex;
    public boolean facetRequested;
    public String facetCountName;
    public Object previousRow;
    public HttpSolrServer solr;
    public SolrDocumentList documentList;
    public List<FacetField.Count> facetCounts;

    public SolrInputData() {
        super();
        recordIndex = 0;
        facetCountName = "";
        facetRequested = false;
        documentList = new SolrDocumentList();
        facetCounts = new ArrayList<FacetField.Count>();
    }
}