int updatePartitionInfo ( String oldHostName , String oldUserDir , String oldLibertyServerName , String oldExecutorIdentifier , String newHostName , String newUserDir , String newLibertyServerName , String newExecutorIdentifier ) throws Exception { PartitionRecord updates = new PartitionRecord ( false ) ; if ( newHostName != null ) updates . setHostName ( newHostName ) ; if ( newUserDir != null ) updates . setUserDir ( newUserDir ) ; if ( newLibertyServerName != null ) updates . setLibertyServer ( newLibertyServerName ) ; if ( newExecutorIdentifier != null ) updates . setExecutor ( newExecutorIdentifier ) ; PartitionRecord expected = new PartitionRecord ( false ) ; if ( oldHostName != null ) expected . setHostName ( oldHostName ) ; if ( oldUserDir != null ) expected . setUserDir ( oldUserDir ) ; if ( oldLibertyServerName != null ) expected . setLibertyServer ( oldLibertyServerName ) ; if ( oldExecutorIdentifier != null ) expected . setExecutor ( oldExecutorIdentifier ) ; int numUpdated = 0 ; TransactionController tranController = new TransactionController ( ) ; try { tranController . preInvoke ( ) ; numUpdated = taskStore . persist ( updates , expected ) ; } catch ( Throwable x ) { tranController . setFailure ( x ) ; } finally { Exception x = tranController . postInvoke ( Exception . class ) ; if ( x != null ) throw x ; } return numUpdated ; }
Updates partition information in the persistent store . The parameters are optional except at least one new value must be specified .