private static boolean exists( FileSystem fileSystem, Path path ) { try { return fileSystem.exists( path ); } catch( IOException exception ) { throw new FlowException( "could not test file exists: " + path ); } }
@Override @ProcessComplete public void complete() { try { super.complete(); } catch(FlowException fe) { // check if we need to unwrap a ProgramAbortException Throwable t = fe.getCause(); if (t instanceof OptimizerPlanEnvironment.ProgramAbortException) { throw (OptimizerPlanEnvironment.ProgramAbortException)t; } else { throw fe; } } }
/** * Constructor FlowException creates a new FlowException instance. * * @param flowName of type String * @param message of type String * @param throwable of type Throwable */ public FlowException( String flowName, String message, Throwable throwable ) { super( createMessage( flowName, message ), throwable ); this.flowName = flowName; }
throw new FlowException( getName(), "thread interrupted", exception ); ( (FlowException) throwable ).setFlowName( getName() ); throw new FlowException( getName(), "unhandled exception", throwable ); throw new FlowException( getName(), "unhandled listener exception", throwable );
private static FileSystem getFileSystem( Configuration config, Path path ) { try { return path.getFileSystem( config ); } catch( IOException exception ) { throw new FlowException( "unable to get handle to underlying filesystem", exception ); } }
public void testWriteToExistingPail() throws Exception { String sourcePath = getTmpPath(fs, "source"); String sinkPath = getTmpPath(fs, "sink"); emitToPail(Pail.create(fs, sourcePath), "a", "b", "c"); Pail.create(fs, sinkPath); try { identityFlow(new PailTap(sourcePath), new PailTap(sinkPath), new Fields("bytes")); fail("should fail!"); } catch (FlowException e) { assertTrue(e.getCause() instanceof IllegalArgumentException); } } }
/** * Constructor FlowException creates a new FlowException instance. * * @param flowName of type String * @param message of type String */ public FlowException( String flowName, String message ) { super( createMessage( flowName, message ) ); this.flowName = flowName; }
public static FileSystem getDefaultFS( Configuration config ) { try { return FileSystem.get( config ); } catch( IOException exception ) { throw new FlowException( "unable to get handle to underlying filesystem", exception ); } }
private static boolean exists( FileSystem fileSystem, Path path ) { try { return fileSystem.exists( path ); } catch( IOException exception ) { throw new FlowException( "could not test file exists: " + path ); } }
private static FileSystem getFileSystem( Configuration config, Path path ) { try { return path.getFileSystem( config ); } catch( IOException exception ) { throw new FlowException( "unable to get handle to underlying filesystem", exception ); } }
public static LocalFileSystem getLocalFS( Configuration config ) { try { return FileSystem.getLocal( config ); } catch( IOException exception ) { throw new FlowException( "unable to get handle to underlying filesystem", exception ); } }
public static FileSystem getDefaultFS( Configuration config ) { try { return FileSystem.get( config ); } catch( IOException exception ) { throw new FlowException( "unable to get handle to underlying filesystem", exception ); } }
public static LocalFileSystem getLocalFS( Configuration config ) { try { return FileSystem.getLocal( config ); } catch( IOException exception ) { throw new FlowException( "unable to get handle to underlying filesystem", exception ); } }
public static Object createProtectedObject( Class type, Object[] parameters, Class[] parameterTypes ) { try { Constructor constructor = type.getDeclaredConstructor( parameterTypes ); constructor.setAccessible( true ); return constructor.newInstance( parameters ); } catch( Exception exception ) { LOG.error( "unable to instantiate type: {}, with exception: {}", type.getName(), exception ); throw new FlowException( "unable to instantiate type: " + type.getName(), exception ); } }
@Override public boolean isSuccessful() { try { return super.isSuccessful(); } catch( NullPointerException exception ) { throw new FlowException( "Hadoop is not keeping a large enough job history, please increase the \'mapred.jobtracker.completeuserjobs.maximum\' property", exception ); } }
private String pack( Object object, Configuration conf ) { try { return serializeBase64( object, conf, true ); } catch( IOException exception ) { throw new FlowException( "unable to pack object: " + object.getClass().getCanonicalName(), exception ); } }
private String pack( Object object, Configuration conf ) { try { return serializeBase64( object, conf, true ); } catch( IOException exception ) { throw new FlowException( "unable to pack object: " + object.getClass().getCanonicalName(), exception ); } }
@Override public boolean isSuccessful() { try { return super.isSuccessful(); } catch( NullPointerException exception ) { throw new FlowException( "Hadoop is not keeping a large enough job history, please increase the \'mapred.jobtracker.completeuserjobs.maximum\' property", exception ); } }
public static String pack( Object object, Configuration conf ) { if( object == null ) return ""; try { return serializeBase64( object, conf, true ); } catch( IOException exception ) { throw new FlowException( "unable to pack object: " + object.getClass().getCanonicalName(), exception ); } }
public static String pack( Object object, Configuration conf ) { if( object == null ) return ""; try { return serializeBase64( object, conf, true ); } catch( IOException exception ) { throw new FlowException( "unable to pack object: " + object.getClass().getCanonicalName(), exception ); } }