本文整理汇总了Java中org.pentaho.di.core.exception.KettlePluginException类的典型用法代码示例。如果您正苦于以下问题:Java KettlePluginException类的具体用法?Java KettlePluginException怎么用?Java KettlePluginException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
KettlePluginException类属于org.pentaho.di.core.exception包,在下文中一共展示了KettlePluginException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFields
import org.pentaho.di.core.exception.KettlePluginException; //导入依赖的package包/类
public void getFields( RowMetaInterface inputRowMeta, String origin, RowMetaInterface[] info, StepMeta nextStep,
VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
if ( !Const.isEmpty( this.valueFieldName ) ) {
// Add value field meta if not found, else set it
ValueMetaInterface v;
try {
v = ValueMetaFactory.createValueMeta( this.valueFieldName, ValueMeta.getType( this.valueTypeName ) );
} catch ( KettlePluginException e ) {
throw new KettleStepException( BaseMessages.getString( PKG,
"HazelcastInputMeta.Exception.ValueTypeNameNotFound" ), e );
}
v.setOrigin( origin );
int valueFieldIndex = inputRowMeta.indexOfValue( this.valueFieldName );
if ( valueFieldIndex < 0 ) {
inputRowMeta.addValueMeta( v );
} else {
inputRowMeta.setValueMeta( valueFieldIndex, v );
}
} else {
throw new KettleStepException( BaseMessages
.getString( PKG, "HazelcastInputMeta.Exception.ValueFieldNameNotFound" ) );
}
}
示例2: getTestObject
import org.pentaho.di.core.exception.KettlePluginException; //导入依赖的package包/类
@Override public RowMetaInterface getTestObject() {
int size = random.nextInt( 10 ) + 1;
RowMetaInterface result = new RowMeta();
for ( int i = 0; i < size; i++ ) {
try {
ValueMetaInterface vm =
ValueMetaFactory.createValueMeta( "field" + i,
i % 2 == 0 ? ValueMetaInterface.TYPE_STRING : ValueMetaInterface.TYPE_NUMBER );
result.addValueMeta( vm );
} catch ( KettlePluginException e ) {
throw new RuntimeException( e );
}
}
return result;
}
示例3: getFields
import org.pentaho.di.core.exception.KettlePluginException; //导入依赖的package包/类
@SuppressWarnings( "deprecation" )
@Override
public void getFields( RowMetaInterface rowMeta, String origin, RowMetaInterface[] info, StepMeta nextStep,
VariableSpace space ) throws KettleStepException {
try {
if ( m_fields == null || m_fields.size() == 0 ){
// TODO: get the name "json" from dialog
ValueMetaInterface jsonValueMeta = ValueMetaFactory.createValueMeta("JSON", ValueMetaInterface.TYPE_STRING);
jsonValueMeta.setOrigin( origin );
rowMeta.addValueMeta( jsonValueMeta );
}else{
// get the selected fields
for ( SequoiaDBInputField f : m_fields ){
ValueMetaInterface vm = ValueMetaFactory.createValueMeta(f.m_fieldName, ValueMetaFactory.getIdForValueMeta( f.m_kettleType ));
vm.setOrigin( origin );
rowMeta.addValueMeta( vm );
}
}
} catch (KettlePluginException e) {
throw new KettleStepException(e);
}
}
示例4: isBigDataPluginInstalled
import org.pentaho.di.core.exception.KettlePluginException; //导入依赖的package包/类
public boolean isBigDataPluginInstalled() throws KettleException
{
if( PluginRegistry.getInstance().findPluginWithId( JobEntryPluginType.class, "HadoopTransJobExecutorPlugin" ) != null )
{
try {
PluginRegistry.getInstance().loadClass(
PluginRegistry.getInstance().findPluginWithId( JobEntryPluginType.class, "HadoopTransJobExecutorPlugin" ) );
} catch (KettlePluginException ex)
{
throw new KettleException( ex.getMessage(), ex );
}
return true;
}
return false;
}
示例5: getFields
import org.pentaho.di.core.exception.KettlePluginException; //导入依赖的package包/类
public void getFields( RowMetaInterface inputRowMeta, String origin, RowMetaInterface[] info, StepMeta nextStep,
VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
if ( !Const.isEmpty( this.valueFieldName ) ) {
// Add value field meta if not found, else set it
ValueMetaInterface v;
try {
v = ValueMetaFactory.createValueMeta( this.valueFieldName, ValueMeta.getType( this.valueTypeName ) );
} catch ( KettlePluginException e ) {
throw new KettleStepException( BaseMessages.getString( PKG,
"MemcachedInputMeta.Exception.ValueTypeNameNotFound" ), e );
}
v.setOrigin( origin );
int valueFieldIndex = inputRowMeta.indexOfValue( this.valueFieldName );
if ( valueFieldIndex < 0 ) {
inputRowMeta.addValueMeta( v );
} else {
inputRowMeta.setValueMeta( valueFieldIndex, v );
}
} else {
throw new KettleStepException( BaseMessages
.getString( PKG, "MemcachedInputMeta.Exception.ValueFieldNameNotFound" ) );
}
}
示例6: getFields
import org.pentaho.di.core.exception.KettlePluginException; //导入依赖的package包/类
@Override
public void getFields(RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException {
String outputField = space.environmentSubstitute(getOutputIDFieldName());
ValueMetaInterface outputInterface = null;
try {
outputInterface = ValueMetaFactory.createValueMeta(outputField, ValueMetaInterface.TYPE_STRING);
} catch (KettlePluginException e) {
throw new KettleStepException(e);
}
boolean fieldFound = false;
for (int i = 0; i < inputRowMeta.size(); i++) {
ValueMetaInterface valueMetaInterface = inputRowMeta.getValueMeta(i);
String interfaceName = valueMetaInterface.getName();
if (outputField.equals(interfaceName)) {
fieldFound = true;
inputRowMeta.setValueMeta(i, outputInterface);
break;
}
}
if (!fieldFound) {
inputRowMeta.addValueMeta(outputInterface);
}
}
示例7: doGet
import org.pentaho.di.core.exception.KettlePluginException; //导入依赖的package包/类
@Override
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
resp.setContentType("image/png");
String id = req.getParameter("name");
PluginInterface pluginInterface = images.get(id);
if (pluginInterface == null) {
for (PluginInterface pluginInterface1 : registry.getPlugins(StepPluginType.class)) {
if (pluginInterface1.getIds()[0].equalsIgnoreCase(id)) {
pluginInterface = pluginInterface1;
}
}
}
OutputStream outputStream = resp.getOutputStream();
try {
IOUtils.copy(getImage(pluginInterface), outputStream);
} catch (KettlePluginException e) {
throw new ServletException(e);
}
outputStream.flush();
}
示例8: createPartitioner
import org.pentaho.di.core.exception.KettlePluginException; //导入依赖的package包/类
public void createPartitioner( String method ) throws KettlePluginException {
methodType = getMethodType(method);
switch ( methodType ) {
case PARTITIONING_METHOD_SPECIAL: {
PluginRegistry registry = PluginRegistry.getInstance();
PluginInterface plugin = registry.findPluginWithId(PartitionerPluginType.class, method);
partitioner = (Partitioner) registry.loadClass(plugin);
partitioner.setId(plugin.getIds()[0]);
break;
}
case PARTITIONING_METHOD_NONE:
default: partitioner = null;
}
if( partitioner != null )
{
partitioner.setMeta(this);
}
}
示例9: registerXmlPlugins
import org.pentaho.di.core.exception.KettlePluginException; //导入依赖的package包/类
protected void registerXmlPlugins() throws KettlePluginException {
for (PluginFolderInterface folder : pluginFolders) {
if (folder.isPluginXmlFolder()) {
List<FileObject> pluginXmlFiles = findPluginXmlFiles(folder.getFolder());
for (FileObject file : pluginXmlFiles) {
try {
Document document = XMLHandler.loadXMLFile(file);
Node pluginNode = XMLHandler.getSubNode(document, "partitioner-plugin");
if (pluginNode!=null) {
registerPluginFromXmlResource(pluginNode, KettleVFS.getFilename(file.getParent()), this.getClass(), false, file.getParent().getURL());
}
} catch(Exception e) {
// We want to report this plugin.xml error, perhaps an XML typo or something like that...
//
log.logError("Error found while reading partitioning plugin.xml file: "+file.getName().toString(), e);
}
}
}
}
}
示例10: registerXmlPlugins
import org.pentaho.di.core.exception.KettlePluginException; //导入依赖的package包/类
protected void registerXmlPlugins() throws KettlePluginException {
for (PluginFolderInterface folder : pluginFolders) {
if (folder.isPluginXmlFolder()) {
List<FileObject> pluginXmlFiles = findPluginXmlFiles(folder.getFolder());
for (FileObject file : pluginXmlFiles) {
try {
Document document = XMLHandler.loadXMLFile(file);
Node pluginNode = XMLHandler.getSubNode(document, "plugin");
if (pluginNode!=null) {
registerPluginFromXmlResource(pluginNode, KettleVFS.getFilename(file.getParent()), this.getClass(), false, file.getParent().getURL());
}
} catch(Exception e) {
// We want to report this plugin.xml error, perhaps an XML typo or something like that...
//
log.logError("Error found while reading step plugin.xml file: "+file.getName().toString(), e);
}
}
}
}
}
示例11: registerXmlPlugins
import org.pentaho.di.core.exception.KettlePluginException; //导入依赖的package包/类
protected void registerXmlPlugins() throws KettlePluginException {
for (PluginFolderInterface folder : pluginFolders) {
if (folder.isPluginXmlFolder()) {
List<FileObject> pluginXmlFiles = findPluginXmlFiles(folder.getFolder());
for (FileObject file : pluginXmlFiles) {
try {
Document document = XMLHandler.loadXMLFile(file);
Node pluginNode = XMLHandler.getSubNode(document, "plugin");
registerPluginFromXmlResource(pluginNode, KettleVFS.getFilename(file.getParent()), this.getClass(), false, file.getParent().getURL());
} catch(Exception e) {
// We want to report this plugin.xml error, perhaps an XML typo or something like that...
//
log.logError("Error found while reading job entry plugin.xml file: "+file.getName().toString(), e);
}
}
}
}
}
示例12: registerXmlPlugins
import org.pentaho.di.core.exception.KettlePluginException; //导入依赖的package包/类
protected void registerXmlPlugins() throws KettlePluginException {
for (PluginFolderInterface folder : pluginFolders) {
if (folder.isPluginXmlFolder()) {
List<FileObject> pluginXmlFiles = findPluginXmlFiles(folder.getFolder());
for (FileObject file : pluginXmlFiles) {
try {
Document document = XMLHandler.loadXMLFile(file);
Node pluginNode = XMLHandler.getSubNode(document, "plugin");
registerPluginFromXmlResource(pluginNode, KettleVFS.getFilename(file.getParent()), this.getClass(), false, file.getParent().getURL());
} catch(Exception e) {
// We want to report this plugin.xml error, perhaps an XML typo or something like that...
//
log.logError("Error found while reading repository plugin.xml file: "+file.getName().toString(), e);
}
}
}
}
}
示例13: registerXmlPlugins
import org.pentaho.di.core.exception.KettlePluginException; //导入依赖的package包/类
protected void registerXmlPlugins() throws KettlePluginException {
for ( PluginFolderInterface folder : pluginFolders ) {
if ( folder.isPluginXmlFolder() ) {
List<FileObject> pluginXmlFiles = findPluginXmlFiles( folder.getFolder() );
for ( FileObject file : pluginXmlFiles ) {
try {
Document document = XMLHandler.loadXMLFile( file );
Node pluginNode = XMLHandler.getSubNode( document, "plugin" );
if ( pluginNode != null ) {
registerPluginFromXmlResource( pluginNode, KettleVFS.getFilename( file.getParent() ), this
.getClass(), false, file.getParent().getURL() );
}
} catch ( Exception e ) {
// We want to report this plugin.xml error, perhaps an XML typo or
// something like that...
//
log.logError( "Error found while reading step plugin.xml file: " + file.getName().toString(), e );
}
}
}
}
}
示例14: setup
import org.pentaho.di.core.exception.KettlePluginException; //导入依赖的package包/类
@Before
public void setup() throws IOException, KettlePluginException {
PluginRegistry.addPluginType( ValueMetaPluginType.getInstance() );
PluginRegistry.init();
GaData gaData = new GaData();
headers = new ArrayList<>();
headers.add( createColumnHeader( "DIMENSION", "ga:date", null ) );
headers.add( createColumnHeader( "DIMENSION", "ga:daysSinceLastVisit", null ) );
headers.add( createColumnHeader( "DIMENSION", "ga:visitLength", null ) );
headers.add( createColumnHeader( "DIMENSION", "ga:visitCount", null ) );
headers.add( createColumnHeader( "DIMENSION", "ga:latitude", null ) );
headers.add( createColumnHeader( "DIMENSION", "ga:longitude", null ) );
headers.add( createColumnHeader( "DIMENSION", "ga:other", null ) );
headers.add( createColumnHeader( "METRIC", "currency", "currency" ) );
headers.add( createColumnHeader( "METRIC", "float", "float" ) );
headers.add( createColumnHeader( "METRIC", "percent", "percent" ) );
headers.add( createColumnHeader( "METRIC", "us_currency", "us_currency" ) );
headers.add( createColumnHeader( "METRIC", "time", "time" ) );
headers.add( createColumnHeader( "METRIC", "integer", "integer" ) );
headers.add( createColumnHeader( "METRIC", "other", "other" ) );
gaData.setColumnHeaders( headers );
gaData.setProfileInfo( new GaData.ProfileInfo() );
List<List<String>> data = new ArrayList<>();
data.add( new ArrayList<String>() );
gaData.setRows( data );
doReturn( gaData ).when( query ).execute();
doReturn( tableItem ).when( table ).getItem( anyInt() );
tableView.table = table;
doReturn( tableView ).when( dialog ).getTableView();
doCallRealMethod().when( dialog ).getFields();
doReturn( query ).when( dialog ).getPreviewQuery();
doReturn( mock( GaInputStepMeta.class ) ).when( dialog ).getInput();
}
示例15: setup
import org.pentaho.di.core.exception.KettlePluginException; //导入依赖的package包/类
@Before
public void setup() throws KettlePluginException {
mockSpace = mock( VariableSpace.class );
doReturn("N" ).when( mockSpace ).getVariable( any(), anyString() );
rowMeta = spy( new RowMeta() );
memoryGroupByMeta = spy( new MemoryGroupByMeta() );
mockStatic( ValueMetaFactory.class );
when( ValueMetaFactory.createValueMeta( anyInt() ) ).thenCallRealMethod();
when( ValueMetaFactory.createValueMeta( anyString(), anyInt() ) ).thenCallRealMethod();
when( ValueMetaFactory.createValueMeta( "maxDate", 3, -1, -1 ) ).thenReturn( new ValueMetaDate( "maxDate" ) );
when( ValueMetaFactory.createValueMeta( "minDate", 3, -1, -1 ) ).thenReturn( new ValueMetaDate( "minDate" ) );
when( ValueMetaFactory.createValueMeta( "countDate", 5, -1, -1 ) ).thenReturn( new ValueMetaInteger( "countDate" ) );
when( ValueMetaFactory.getValueMetaName( 3 ) ).thenReturn( "Date" );
when( ValueMetaFactory.getValueMetaName( 5 ) ).thenReturn( "Integer" );
}