Package com.arjuna.ats.arjuna.common
Class CoordinatorEnvironmentBean
- java.lang.Object
-
- com.arjuna.ats.arjuna.common.CoordinatorEnvironmentBean
-
- All Implemented Interfaces:
CoordinatorEnvironmentBeanMBean
public class CoordinatorEnvironmentBean extends java.lang.Object implements CoordinatorEnvironmentBeanMBean
A JavaBean containing configuration properties for the core transaction coordinator.- Author:
- Jonathan Halliday<EMAIL_ADDRESS>-
-
Constructor Summary
Constructors Constructor Description CoordinatorEnvironmentBean()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description CheckedActionFactory
getCheckedActionFactory()
Returns an instance of a class implementing CheckedActionFactory.java.lang.String
getCheckedActionFactoryClassName()
Returns the class name of an implementation of CheckedActionFactory Default: "com.arjuna.ats.internal.arjuna.coordinator.CheckedActionFactoryImple" Equivalent deprecated property: com.arjuna.ats.coordinator.checkedActionFactoryjava.lang.String
getCommunicationStore()
Deprecated.int
getDefaultTimeout()
Returns the default interval after which a transaction may be considered for timeout, in seconds.boolean
getDynamic1PC()
Returns true if dynamic one phase commit optimization is to be used.int
getMaxTwoPhaseCommitThreads()
Returns maximum thread pool size allowed for two phase commits.long
getTxReaperCancelFailWaitPeriod()
Returns the number of millisecs delay after a worker thread is interrupted, before the reaper writes the it off as a zombie and starts a new thread.long
getTxReaperCancelWaitPeriod()
Returns the number of millisecs delay after a cancel is scheduled, before the reaper tries to interrupt the worker thread executing the cancel.java.lang.String
getTxReaperMode()
Returns the operating mode of the transaction timeout processing system.long
getTxReaperTimeout()
Returns the timeout (wakeup) interval of the reaper's PERIODIC mode, in milliseconds.long
getTxReaperTraceGracePeriod()
Returns the number of milliseconds delay after a transaction is started, before the reaper will start taking periodic stack traces from it.long
getTxReaperTraceInterval()
Returns the number of milliseconds interval between transaction stack trace snapshots.int
getTxReaperZombieMax()
Returns the threshold for count of non-exited zombies at which the system starts logging error messages.boolean
isAllowCheckedActionFactoryOverride()
Returns true if configured to allow the checked action factory to be overriden Default: trueboolean
isAlternativeRecordOrdering()
Whether to use the alternative abstract record ordering.boolean
isAsyncAfterSynchronization()
Returns true if asynchronous after completion behaviour is enabled.boolean
isAsyncBeforeSynchronization()
Returns true if asynchronous before completion behaviour is enabled.boolean
isAsyncCommit()
Returns true if anynchronous commit behaviour is enabled.boolean
isAsyncPrepare()
Returns true if asynchronous prepare behaviour is enabled.boolean
isAsyncRollback()
Returns true if asynchronous rollback behaviour is enabled.boolean
isBeforeCompletionWhenRollbackOnly()
Returns if beforeCompletion should be called on Synchronizations when completing transactions that are marked rollback only.boolean
isClassicPrepare()
Returns true if the old style of prepare handling should be used for PersistenceRecord.boolean
isCommitOnePhase()
Returns true if one phase commit optimization is to be used.boolean
isEnableStatistics()
Returns true if transaction statistics should be recorded.boolean
isFinalizeBasicActions()
Sets whether or not to use finalizers for BasicActions (i.e.boolean
isMaintainHeuristics()
Returns true if heuristic outcomes should be recorded.boolean
isReadonlyOptimisation()
Returns true if handling of read only resources should be optimized.boolean
isSharedTransactionLog()
Deprecated.boolean
isStartDisabled()
Returns if the transaction manager should be created in a disabled state or not.boolean
isTransactionStatusManagerEnable()
Returns if the transaction status manager (TSM) service, needed for out of process recovery, should be provided or not.boolean
isWriteOptimisation()
Returns true if write optimisation protocol should be used for PersistenceRecord.void
setAllowCheckedActionFactoryOverride(boolean allowCheckedActionFactoryOverride)
Can be enabled to allow the checked action factory to be overridden at runtimevoid
setAlternativeRecordOrdering(boolean alternativeRecordOrdering)
Set whether or not to use the alternative abstract record ordering.void
setAsyncAfterSynchronization(boolean asyncAfterSynchronization)
Sets if asynchronous after completion behaviour should be enabled or not.void
setAsyncBeforeSynchronization(boolean asyncBeforeSynchronization)
Sets if asynchronous before completion behaviour should be enabled or not.void
setAsyncCommit(boolean asyncCommit)
Sets if asynchronous commit behaviour should be enabled or not.void
setAsyncPrepare(boolean asyncPrepare)
Sets if asynchronous prepare behaviour should be enabled or not.void
setAsyncRollback(boolean asyncRollback)
Sets if asynchronous rollback behaviour should be enabled or not.void
setBeforeCompletionWhenRollbackOnly(boolean beforeCompletionWhenRollbackOnly)
Sets if beforeCompletion should be called on transactions that are set rollback only.void
setCheckedActionFactory(CheckedActionFactory instance)
Sets the instance of CheckedActionFactory.void
setCheckedActionFactoryClassName(java.lang.String checkedActionFactoryClassName)
Sets the class name of the CheckedActionFactory implementation.void
setClassicPrepare(boolean classicPrepare)
Sets if old style prepare handling should be used for PersistenceRecord.void
setCommitOnePhase(boolean commitOnePhase)
Sets if one phase commit behaviour is enabled or not.void
setCommunicationStore(java.lang.String communicationStore)
Deprecated.void
setDefaultTimeout(int defaultTimeout)
Sets the default lifetime after which a transaction may be considered for timeout, in seconds.void
setDynamic1PC(boolean dynamic1PC)
Sets if dynamic one phase commit behaviour is enabled or not.void
setEnableStatistics(boolean enableStatistics)
Sets if transaction statistics should be recorded or not.void
setFinalizeBasicActions(boolean finalizeBasicActions)
Sets whether or not to use finalizers for BasicActions (i.e.void
setMaintainHeuristics(boolean maintainHeuristics)
Sets if heuristics should be recorded or not.void
setMaxTwoPhaseCommitThreads(int maxTwoPhaseCommitThreads)
Sets maximum thread pool size for two phase commits.void
setReadonlyOptimisation(boolean readonlyOptimisation)
Sets if handling of read only resources should be optimized.void
setSharedTransactionLog(boolean sharedTransactionLog)
Deprecated.void
setStartDisabled(boolean startDisabled)
Sets if the transaction manager should be created in a disabled state or not.void
setTransactionStatusManagerEnable(boolean transactionStatusManagerEnable)
Sets if the transaction status manager service should be provided or not.void
setTxReaperCancelFailWaitPeriod(long txReaperCancelFailWaitPeriod)
Sets the delay to allow an interrupted cancel to be cleaned up.void
setTxReaperCancelWaitPeriod(long txReaperCancelWaitPeriod)
Sets the delay to allow a cancel to be processed before interrupting it.void
setTxReaperMode(java.lang.String txReaperMode)
Sets the operating mode of the transaction timeout processing system.void
setTxReaperTimeout(long txReaperTimeout)
Sets the timeout interval of the transaction reaper.void
setTxReaperTraceGracePeriod(long txReaperTraceGracePeriod)
Sets the delay after a transaction is started, before it is eligible for periodic tracing.void
setTxReaperTraceInterval(long txReaperTraceInterval)
Sets the interval between stack trace snapshots.void
setTxReaperZombieMax(int txReaperZombieMax)
Sets the threshold number of zombie threads at which errors will start to be reported.void
setWriteOptimisation(boolean writeOptimisation)
Sets if write optimization protocol should be used for PersistenceRecord.
-
-
-
Method Detail
-
isAsyncCommit
public boolean isAsyncCommit()
Returns true if anynchronous commit behaviour is enabled. Default: false Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.asyncCommit- Specified by:
isAsyncCommit
in interfaceCoordinatorEnvironmentBeanMBean
- Returns:
- true if asynchronous commit is enabled, value otherwise.
-
setAsyncCommit
public void setAsyncCommit(boolean asyncCommit)
Sets if asynchronous commit behaviour should be enabled or not. Note: heuristics cannot be reported programatically if asynchronous commit is used. If true then a separate thread will be created to complete the second phase of the action (provided that knowledge about heuristic outcomes is not required).- Parameters:
asyncCommit
- true to enable asynchronous commit, false to disable.
-
isAsyncPrepare
public boolean isAsyncPrepare()
Returns true if asynchronous prepare behaviour is enabled. If true then during the prepare phase of an action a separate thread will be created for preparing each participant registered with the action Default: false Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.asyncPrepare- Specified by:
isAsyncPrepare
in interfaceCoordinatorEnvironmentBeanMBean
- Returns:
- true if asynchronous prepare is enabled, false otherwise.
-
setAsyncPrepare
public void setAsyncPrepare(boolean asyncPrepare)
Sets if asynchronous prepare behaviour should be enabled or not.- Parameters:
asyncPrepare
- true to enable asynchronous prepare, false to disable.
-
isAsyncRollback
public boolean isAsyncRollback()
Returns true if asynchronous rollback behaviour is enabled. If true then a separate thread will be created to complete the second phase of the action Default: false Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.asyncRollback- Specified by:
isAsyncRollback
in interfaceCoordinatorEnvironmentBeanMBean
- Returns:
- true if asynchronous rollback is enabled, false otherwise.
-
setAsyncRollback
public void setAsyncRollback(boolean asyncRollback)
Sets if asynchronous rollback behaviour should be enabled or not.- Parameters:
asyncRollback
- true to enable asynchronous rollback, false to disable.
-
getMaxTwoPhaseCommitThreads
public int getMaxTwoPhaseCommitThreads()
Returns maximum thread pool size allowed for two phase commits. Default: 100- Returns:
- maximum number of threads in a thread pool
-
setMaxTwoPhaseCommitThreads
public void setMaxTwoPhaseCommitThreads(int maxTwoPhaseCommitThreads)
Sets maximum thread pool size for two phase commits.- Parameters:
maxTwoPhaseCommitThreads
- maximum number of threads in a thread pool
-
isCommitOnePhase
public boolean isCommitOnePhase()
Returns true if one phase commit optimization is to be used. Default: true Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.commitOnePhase- Specified by:
isCommitOnePhase
in interfaceCoordinatorEnvironmentBeanMBean
- Returns:
- true if one phase commit is enabled, false otherwise.
-
setCommitOnePhase
public void setCommitOnePhase(boolean commitOnePhase)
Sets if one phase commit behaviour is enabled or not.- Parameters:
commitOnePhase
- true to enable, false to disable.
-
getDynamic1PC
public boolean getDynamic1PC()
Returns true if dynamic one phase commit optimization is to be used. This means that if the first N-1 participants in the intentions list return read-only then commit_one_phase will be called on the last participant. Default: true Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.dynamic1PC- Returns:
- true if one phase commit is enabled, false otherwise.
-
setDynamic1PC
public void setDynamic1PC(boolean dynamic1PC)
Sets if dynamic one phase commit behaviour is enabled or not.- Parameters:
dynamic1PC
- true to enable, false to disable.
-
isMaintainHeuristics
public boolean isMaintainHeuristics()
Returns true if heuristic outcomes should be recorded. Default: true Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.maintainHeuristics- Specified by:
isMaintainHeuristics
in interfaceCoordinatorEnvironmentBeanMBean
- Returns:
- true if heuristics should be recorded, false otherwise.
-
setMaintainHeuristics
public void setMaintainHeuristics(boolean maintainHeuristics)
Sets if heuristics should be recorded or not.- Parameters:
maintainHeuristics
- true to enable recording of heuristics, false to disable.
-
isWriteOptimisation
public boolean isWriteOptimisation()
Returns true if write optimisation protocol should be used for PersistenceRecord. Default: false Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.transactionLog.writeOptimisation- Specified by:
isWriteOptimisation
in interfaceCoordinatorEnvironmentBeanMBean
- Returns:
- true if write optimisation is enabled, false otherwise.
-
setWriteOptimisation
public void setWriteOptimisation(boolean writeOptimisation)
Sets if write optimization protocol should be used for PersistenceRecord.- Parameters:
writeOptimisation
- true to enable write optimization, false to disable.
-
isReadonlyOptimisation
public boolean isReadonlyOptimisation()
Returns true if handling of read only resources should be optimized. Default: true Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.readonlyOptimisation- Specified by:
isReadonlyOptimisation
in interfaceCoordinatorEnvironmentBeanMBean
- Returns:
- true if read only optimization is enabled, false otherwise.
-
setReadonlyOptimisation
public void setReadonlyOptimisation(boolean readonlyOptimisation)
Sets if handling of read only resources should be optimized.- Parameters:
readonlyOptimisation
- true to enable read only optimization, false to disable.
-
isClassicPrepare
public boolean isClassicPrepare()
Returns true if the old style of prepare handling should be used for PersistenceRecord. Default: false Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.classicPrepare- Specified by:
isClassicPrepare
in interfaceCoordinatorEnvironmentBeanMBean
- Returns:
- true is classic prepare handling is enabled, false otherwise.
-
setClassicPrepare
public void setClassicPrepare(boolean classicPrepare)
Sets if old style prepare handling should be used for PersistenceRecord.- Parameters:
classicPrepare
- true to enable classic prepare handling, false to disable.
-
isEnableStatistics
public boolean isEnableStatistics()
Returns true if transaction statistics should be recorded. Note: Enabling statistics may have a slight performance impact due to locking on the counter variables. Default: false Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.enableStatistics Effect: immediate.- Specified by:
isEnableStatistics
in interfaceCoordinatorEnvironmentBeanMBean
- Returns:
- true if recording of transaction statistics is enabled, false otherwise.
-
setEnableStatistics
public void setEnableStatistics(boolean enableStatistics)
Sets if transaction statistics should be recorded or not.- Specified by:
setEnableStatistics
in interfaceCoordinatorEnvironmentBeanMBean
- Parameters:
enableStatistics
- true to enable statistics gathering, false to disable.
-
isSharedTransactionLog
@Deprecated public boolean isSharedTransactionLog()
Deprecated.Returns if the transaction log should be run in shared mode or not. Default: false Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.sharedTransactionLog- Specified by:
isSharedTransactionLog
in interfaceCoordinatorEnvironmentBeanMBean
- Returns:
- true if transaction log sharing is enabled, false otherwise.
-
setSharedTransactionLog
@Deprecated public void setSharedTransactionLog(boolean sharedTransactionLog)
Deprecated.Sets if the transaction log should be run in shared mode or not.- Parameters:
sharedTransactionLog
- true to enable transaction log sharing, false to disable.
-
isStartDisabled
public boolean isStartDisabled()
Returns if the transaction manager should be created in a disabled state or not. Default: false (i.e. transaction manager is enabled on creation) Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.startDisabled- Specified by:
isStartDisabled
in interfaceCoordinatorEnvironmentBeanMBean
- Returns:
- true if the transaction manager will start in a disabled state, false otherwise.
-
setStartDisabled
public void setStartDisabled(boolean startDisabled)
Sets if the transaction manager should be created in a disabled state or not.- Parameters:
startDisabled
- true to start in a diabled state, false to start enabled.
-
getTxReaperMode
public java.lang.String getTxReaperMode()
Returns the operating mode of the transaction timeout processing system. Default: "DYNAMIC" Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.txReaperMode- Specified by:
getTxReaperMode
in interfaceCoordinatorEnvironmentBeanMBean
- Returns:
- the operating mode of the transaction reaper.
-
setTxReaperMode
public void setTxReaperMode(java.lang.String txReaperMode)
Sets the operating mode of the transaction timeout processing system.- Parameters:
txReaperMode
- the name of the required operating mode.
-
getTxReaperTimeout
public long getTxReaperTimeout()
Returns the timeout (wakeup) interval of the reaper's PERIODIC mode, in milliseconds. Default: 120000ms Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.txReaperTimeout- Specified by:
getTxReaperTimeout
in interfaceCoordinatorEnvironmentBeanMBean
- Returns:
- the sleep interval of the transaction reaper, in milliseconds.
-
setTxReaperTimeout
public void setTxReaperTimeout(long txReaperTimeout)
Sets the timeout interval of the transaction reaper.- Parameters:
txReaperTimeout
- the reaper sleep interval, in milliseconds.
-
getTxReaperCancelWaitPeriod
public long getTxReaperCancelWaitPeriod()
Returns the number of millisecs delay after a cancel is scheduled, before the reaper tries to interrupt the worker thread executing the cancel. Default: 500ms Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.txReaperCancelWaitPeriod- Specified by:
getTxReaperCancelWaitPeriod
in interfaceCoordinatorEnvironmentBeanMBean
- Returns:
- the reaper cancel wait period, in milliseconds.
-
setTxReaperCancelWaitPeriod
public void setTxReaperCancelWaitPeriod(long txReaperCancelWaitPeriod)
Sets the delay to allow a cancel to be processed before interrupting it.- Parameters:
txReaperCancelWaitPeriod
- in milliseconds.
-
getTxReaperCancelFailWaitPeriod
public long getTxReaperCancelFailWaitPeriod()
Returns the number of millisecs delay after a worker thread is interrupted, before the reaper writes the it off as a zombie and starts a new thread. Default: 500ms Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.txReaperCancelFailWaitPeriod- Specified by:
getTxReaperCancelFailWaitPeriod
in interfaceCoordinatorEnvironmentBeanMBean
- Returns:
- the reaper cancel wait fail period, in milliseconds.
-
setTxReaperCancelFailWaitPeriod
public void setTxReaperCancelFailWaitPeriod(long txReaperCancelFailWaitPeriod)
Sets the delay to allow an interrupted cancel to be cleaned up.- Parameters:
txReaperCancelFailWaitPeriod
- in milliseconds.
-
getTxReaperZombieMax
public int getTxReaperZombieMax()
Returns the threshold for count of non-exited zombies at which the system starts logging error messages. Default: 8 Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.txReaperZombieMax- Specified by:
getTxReaperZombieMax
in interfaceCoordinatorEnvironmentBeanMBean
- Returns:
- the number of zombie threads at which errors will start being reported.
-
setTxReaperZombieMax
public void setTxReaperZombieMax(int txReaperZombieMax)
Sets the threshold number of zombie threads at which errors will start to be reported.- Parameters:
txReaperZombieMax
- the number of threads.
-
getTxReaperTraceGracePeriod
public long getTxReaperTraceGracePeriod()
Returns the number of milliseconds delay after a transaction is started, before the reaper will start taking periodic stack traces from it. Default: 180000 (3 minutes)- Specified by:
getTxReaperTraceGracePeriod
in interfaceCoordinatorEnvironmentBeanMBean
- Returns:
- the reaper tracing grace period, in milliseconds.
-
setTxReaperTraceGracePeriod
public void setTxReaperTraceGracePeriod(long txReaperTraceGracePeriod)
Sets the delay after a transaction is started, before it is eligible for periodic tracing.- Parameters:
txReaperTraceGracePeriod
- in milliseconds.
-
getTxReaperTraceInterval
public long getTxReaperTraceInterval()
Returns the number of milliseconds interval between transaction stack trace snapshots. Default: 30000 (30 seconds)- Specified by:
getTxReaperTraceInterval
in interfaceCoordinatorEnvironmentBeanMBean
- Returns:
- the reaper tracing interval, in milliseconds.
-
setTxReaperTraceInterval
public void setTxReaperTraceInterval(long txReaperTraceInterval)
Sets the interval between stack trace snapshots.- Parameters:
txReaperTraceInterval
- in milliseconds.
-
getDefaultTimeout
public int getDefaultTimeout()
Returns the default interval after which a transaction may be considered for timeout, in seconds. Note: depending on the reaper mode and workload, transactions may not be timed out immediately. Default: 60 Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.defaultTimeout- Specified by:
getDefaultTimeout
in interfaceCoordinatorEnvironmentBeanMBean
- Returns:
- the default transaction lifetime, in seconds.
-
setDefaultTimeout
public void setDefaultTimeout(int defaultTimeout)
Sets the default lifetime after which a transaction may be considered for timeout, in seconds.- Parameters:
defaultTimeout
- the default transaction lifetime, in seconds.
-
isTransactionStatusManagerEnable
public boolean isTransactionStatusManagerEnable()
Returns if the transaction status manager (TSM) service, needed for out of process recovery, should be provided or not. Default: true Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.transactionStatusManagerEnable- Specified by:
isTransactionStatusManagerEnable
in interfaceCoordinatorEnvironmentBeanMBean
- Returns:
- true is the transaction status manager is enabled, false otherwise.
-
setTransactionStatusManagerEnable
public void setTransactionStatusManagerEnable(boolean transactionStatusManagerEnable)
Sets if the transaction status manager service should be provided or not.- Parameters:
transactionStatusManagerEnable
- true to enable the TSM, false to disable.
-
isBeforeCompletionWhenRollbackOnly
public boolean isBeforeCompletionWhenRollbackOnly()
Returns if beforeCompletion should be called on Synchronizations when completing transactions that are marked rollback only. Default: false Equivalent deprecated property: com.arjuna.ats.coordinator.beforeCompletionWhenRollbackOnly- Specified by:
isBeforeCompletionWhenRollbackOnly
in interfaceCoordinatorEnvironmentBeanMBean
- Returns:
- true if beforeCompletion will be called in rollback only cases, false otherwise.
-
setBeforeCompletionWhenRollbackOnly
public void setBeforeCompletionWhenRollbackOnly(boolean beforeCompletionWhenRollbackOnly)
Sets if beforeCompletion should be called on transactions that are set rollback only.- Parameters:
beforeCompletionWhenRollbackOnly
- true to call beforeCompletions on rollback only tx, false to skip them.
-
getCheckedActionFactoryClassName
public java.lang.String getCheckedActionFactoryClassName()
Returns the class name of an implementation of CheckedActionFactory Default: "com.arjuna.ats.internal.arjuna.coordinator.CheckedActionFactoryImple" Equivalent deprecated property: com.arjuna.ats.coordinator.checkedActionFactory- Specified by:
getCheckedActionFactoryClassName
in interfaceCoordinatorEnvironmentBeanMBean
- Returns:
- the class name of the CheckedActionFactory implementation to use.
-
setCheckedActionFactoryClassName
public void setCheckedActionFactoryClassName(java.lang.String checkedActionFactoryClassName)
Sets the class name of the CheckedActionFactory implementation.- Parameters:
checkedActionFactoryClassName
- the name of a class that implements CheckedActionFactory.
-
getCheckedActionFactory
public CheckedActionFactory getCheckedActionFactory()
Returns an instance of a class implementing CheckedActionFactory. If there is no pre-instantiated instance set and classloading or instantiation fails, this method will log appropriate warning and return null, not throw an exception.- Returns:
- a CheckedActionFactory implementation instance, or null.
-
setCheckedActionFactory
public void setCheckedActionFactory(CheckedActionFactory instance)
Sets the instance of CheckedActionFactory.- Parameters:
instance
- an Object that implements CheckedActionFactory, or null.
-
isAlternativeRecordOrdering
public boolean isAlternativeRecordOrdering()
Whether to use the alternative abstract record ordering. At present this is not fully documented, so stay away! Default: false- Returns:
true
if order abstract records on type first, orfalse
if order on Uid first.
-
setAlternativeRecordOrdering
public void setAlternativeRecordOrdering(boolean alternativeRecordOrdering)
Set whether or not to use the alternative abstract record ordering. Don't try this whilst the system is running!- Parameters:
alternativeRecordOrdering
- true for alternative (i.e. type) ordering, false for normal (i.e. Uid) ordering.
-
getCommunicationStore
@Deprecated public java.lang.String getCommunicationStore()
Deprecated.Returns the symbolic name for the communication store type. Default: "HashedActionStore"- Specified by:
getCommunicationStore
in interfaceCoordinatorEnvironmentBeanMBean
- Returns:
- the communication store name.
-
setCommunicationStore
@Deprecated public void setCommunicationStore(java.lang.String communicationStore)
Deprecated.Sets the symbolic name of the communication store.- Parameters:
communicationStore
- the communication store name.
-
isFinalizeBasicActions
public boolean isFinalizeBasicActions()
Sets whether or not to use finalizers for BasicActions (i.e. transactions). This can provide a useful safety net to ensure cleanup of locks and other resources, but does not perform well. In most cases it's preferable to set a transaction timeout and rely on the reaper for cleanup. Default: false- Returns:
- true if a finalize method should be registered for BasicActions instances, false otherwise.
-
setFinalizeBasicActions
public void setFinalizeBasicActions(boolean finalizeBasicActions)
Sets whether or not to use finalizers for BasicActions (i.e. transactions).- Parameters:
finalizeBasicActions
- true to enable finalization, false to disable.
-
isAsyncBeforeSynchronization
public boolean isAsyncBeforeSynchronization()
Returns true if asynchronous before completion behaviour is enabled. The option is applicable to the volatile phase of the two phase commit protocol which provides a synchronization mechanism that allows an interested party to be notified before and after the transaction completes. If set to true then the beforeCompletion method will be called on all non interposed synchronizations in parallel, after which the beforeCompletion method will be called on all interposed synchronizations in parallel. Default: false- Returns:
- true if asynchronous before completion is enabled, value otherwise.
-
setAsyncBeforeSynchronization
public void setAsyncBeforeSynchronization(boolean asyncBeforeSynchronization)
Sets if asynchronous before completion behaviour should be enabled or not.- Parameters:
asyncBeforeSynchronization
- true to enable asynchronous before completion, false to disable.
-
isAsyncAfterSynchronization
public boolean isAsyncAfterSynchronization()
Returns true if asynchronous after completion behaviour is enabled. The option is applicable to the volatile phase of the two phase commit protocol which provides a synchronization mechanism that allows an interested party to be notified before and after the transaction completes. If set to true then the afterCompletion method will be called on all interposed synchronizations in parallel, after which the afterCompletion method will be called on all non interposed synchronizations in parallel. Caveat: if an action is committed and the caller wishes to be notified of heuristics outcomes then this behaviour is not available and the afterCompletion callbacks will be invoked synchronously. . Default: false- Returns:
- true if asynchronous after completion is enabled, value otherwise.
-
setAsyncAfterSynchronization
public void setAsyncAfterSynchronization(boolean asyncAfterSynchronization)
Sets if asynchronous after completion behaviour should be enabled or not.- Parameters:
asyncAfterSynchronization
- true to enable asynchronous after completion, false to disable.
-
isAllowCheckedActionFactoryOverride
public boolean isAllowCheckedActionFactoryOverride()
Returns true if configured to allow the checked action factory to be overriden Default: true- Returns:
- true if checked action factory can be overriden, false otherwise.
-
setAllowCheckedActionFactoryOverride
public void setAllowCheckedActionFactoryOverride(boolean allowCheckedActionFactoryOverride)
Can be enabled to allow the checked action factory to be overridden at runtime- Parameters:
allowCheckedActionFactoryOverride
- Allow the checked action factory to be overriden
-
-


About Me
Web Developer
Skills
Scroll to see all Skill
Projects
Job Portal
HTML5
CSS
Javascript
JQuery
Bootstrap
AngularJS
MySQL
GIT
This portal helps the job seekers to apply for jobs for the listed companies. Jobs can be searched by applying filters like the job type, location and based on the experience or can search a particular job directly and can apply for it by uploading his resume. Admin can view all positions details, candidate details and the positions applied but the candidates individually.
Shopping Cart
HTML5
CSS3
Bootstrap
Javascript
JQuery
MYSQL
Our ecommerce application resembles today’s ecommerce website like EBay and Amazon. This application has three major role’s Admin, Seller, and Buyer. Admin can see all the transactions and also can search for a particular transaction directly or by using the filters. Seller can add/ delete the items and provide the shipping labels. Buyers can search for the items and can provide the feed back for the seller’s and products.
Document Search Engine
HTML5
CSS3
Bootstrap
JSP
JSON
Javascript
Oracle
The main purpose of this is to search a document in the university database. The searching can be done in category wise. Extracting the data and indexing is done with the help of Lucene and Tika. The user can login, upload documents and can view & download the documents uploaded by the other users.
Sterling Back Check
HTML5
CSS3
JavaScript
Bootstrap
JQuery
AJAX
MySQL
The project is related to background screening for the employees in the organizations. This helps to schedule an appointment, view previous medical records and customer service. Displaying the list of diagnostic center’s nearby location, using the location services. The generated reports are sent to the client directly.
E-Services
HTML5
CSS3
JSP
Javascript
MySQL
The project “E-SERVICES” is an online web application which is introduced to solve some of the real time problems that everyone is facing today. This project is mainly developed to improve the quality of electronic services especially in government sector. This project visualizes most of the important and necessary activities which are mandatory for all citizens who are living in the society. The vital role of this application is to make an appointment for various government activities. So that it makes each and every user to get their basic needs of society. The acknowledgement is provided in terms of E-mail.
Education
Kent State University, Kent, OH
AUG 2014 - DEC 2015
Master's of Science in Digital Sciences(Software Development) GPA: 3.82
Sri Sai Aditya Institute of Science and Technology, Surampalem, India
AUG 2010 - JULY 2014
Bachelor's of Technology(B.Tech), Computer Science
Contact
(571)-291-1096 vankayala.suraj@gmail.com


I think cybernetics is a useful tool for learning more about reality, but I wouldn’t call it a foolproof, accurate method of describing reality. It’s true that many aspects of the world function as systems - the environment, weather, the water, carbon, and nitrogen cycles, the political systems we create, systems of communication and cultural dissemination - I could go on and on. But these systems, as the movie explained, can’t be reduced or simplified, even with the help of computers. Ultimately, things are complex beyond our understanding and we shouldn’t rely on our or even our computers’ ability to correctly determine every factor and its exact influence on other factors of a system.


National Taiwan University of Science and Technology
& Department Of Information Management
Name : 江晉豪(EVAN)
From : Kaohsiung
Date Of Birth : 1997/07/01
Education : KSVS CSIE -> NTUST MIS
Club : NTUST ROCK LAB
Hobby : Singing ,Listening to the Music,Volleyball......

Recommend to everyone some
of my favorite band .
With my
Please click on the pictures below,and you can know more !
If you like music too, maybe me can become good friend. Don't be shy, Let's enjoy music together !
© Evan B10409038


The goals of this component are: 1) to monitor the prevalence and trends in major cardiovascular conditions, and overall risk factors in the U.S.; and 2) to evaluate prevention and treatment programs targeting cardiovascular disease in the U.S.
Blood lipid levels are the main elements of the cardiovascular disease laboratory in NHANES. Cardiovascular disease is the leading cause of death in the United States. The data will be used to monitor the status of hyperlipidemia, and the success of the National Cholesterol Education Program.
Participants aged 12 years and older who were examined in the morning session were eligible.
This method is based on the work by Wahlefeld (Roche, 2014) using a lipoprotein lipase from microorganisms for the rapid and complete hydrolysis of triglycerides to glycerol followed by oxidation to dihydroxyacetone phosphate and hydrogen peroxide. The hydrogen peroxide produced then reacts with 4-aminophenazone and 4-chlorophenol under the catalytic action of peroxidase to form a red dyestuff (Trinder endpoint reaction). The color intensity of the red dyestuff formed is directly proportional to the triglyceride concentration and can be measured photometrically.
Triglycerides are fatty acid esters of glycerol that have three hydroxyl groups. Because they are insoluble in water, the triglycerides are transported with other more polar lipids. Elevated triglyceride measurements are associated with diabetes mellitus, pancreatitis, alcoholism, glycogen storage disease, hypothyroidism, nephrosis, pregnancy, use of oral contraceptives and gout. Triglyceride levels are decreased in hyperthyroidism, use of certain lipid-lowering drugs and malabsorption syndrome.
Refer to the Laboratory Method Files section for a detailed description of the laboratory methods used.
There were no changes to the lab method, lab equipment, or lab site for this component in the NHANES 2015-2016 cycle.
Triglycerides (January 2019)
Serum samples were processed, stored, and shipped to University of Minnesota, Minneapolis, MN for analysis.
Detailed instructions on specimen collection and processing are discussed in the NHANES Laboratory Procedures Manual (LPM). Vials are stored under appropriate frozen (–30°C) conditions until they are shipped to University of Minnesota for testing.
The NHANES quality assurance and quality control protocols (QA/QC) meet the 1988 Clinical Laboratory Improvement Act mandates. Detailed QA/QC instructions are discussed in the NHANES LPM.
Mobile Examination Centers (MECs)
Laboratory team performance is monitored using several techniques. NCHS and contract consultants use a structured competency assessment evaluation during visits to evaluate both the quality of the laboratory work and the quality-control procedures. Each laboratory staff member is observed for equipment operation, specimen collection and preparation; testing procedures and constructive feedback are given to each staff member. Formal retraining sessions are conducted annually to ensure that required skill levels were maintained.
Analytical Laboratories
NHANES uses several methods to monitor the quality of the analyses performed by the contract laboratories. In the MEC, these methods include performing blind split samples collected during “dry run” sessions. In addition, contract laboratories randomly perform repeat testing on 2% of all specimens.
NCHS developed and distributed a quality control protocol for all CDC and contract laboratories, which outlined the use of Westgard rules (Westgard, et al. 1981) when running NHANES specimens. Progress reports containing any problems encountered during shipping or receipt of specimens, summary statistics for each control pool, QC graphs, instrument calibration, reagents, and any special considerations are submitted to NCHS quarterly. The reports are reviewed for trends or shifts in the data. The laboratories are required to explain any identified areas of concern.
The data were reviewed. Incomplete data or improbable values were sent to the performing laboratory for confirmation.
Three derived variables were created in this data file. The variables were created using the following formula:
LBDTRSI
The triglycerides value in mg/dL (LBXTR) was converted to mmol/L (LBDTRSI) by multiplying by 0.01129.
LBDLDL
Serum Low-Density Lipoprotein (LDL)-cholesterol levels were derived on study participants who were examined in the morning session only. The distribution of serum LDL-cholesterol should be estimated only on participants aged 12 and above who fasted at least 8.5 hours or more, but less than 24 hours in the morning session. LDL-cholesterol is calculated from measured values of total cholesterol, triglycerides, and HDL-cholesterol according to the Friedewald calculation:
[LDL-cholesterol] = [total cholesterol] – [HDL-cholesterol] – [triglycerides/5]
where all values are expressed in mg/dL. The calculation is valid for triglycerides less than or equal to 400 mg/dL.
LBDLDLSI
The LDL-cholesterol in mg/dL (LBDLDL) was converted to mmol/L (LBDLDLSI) by multiplying by 0.02586.
Refer to the 2015-2016 Laboratory Data Overview for general information on NHANES laboratory data.
Subsample Weights
Triglycerides were measured in a fasting subsample of participants 12 years and
older. Special sample weights are required to analyze these data properly.
Specific sample weights for this subsample are included in this data file and
should be used when analyzing these data.
Demographic and Other Related Variables
The analysis of NHANES laboratory data must be conducted using the appropriate survey design and demographic variables. The NHANES 2015-2016 Demographics File contains demographic data, health indicators, and other related information collected during household interviews as well as the sample weight variables. The recommended procedure for variance estimation requires use of stratum and PSU variables (SDMVSTRA and SDMVPSU, respectively) in the demographic data file.
The Fasting Questionnaire File includes auxiliary information, such as fasting status, length of fast, and the time of venipuncture.
The laboratory data file can be linked to the other NHANES data files using the unique survey participant identifier (i.e., SEQN).
LBXTR and LBXLDL
Serum levels were measured for participants that were examined in the morning session only. The distribution of serum triglycerides should be estimated only on participants aged 12 and above who fasted at least 8.5 hours or more, but less than 24 hours.
The TRIGLY_I data
file contains laboratory test results for triglycerides (LBXTR) using the
reference analytic method. However, the NHANES Standard Biochemistry Profile
(BIOPRO_I) also includes measurements of triglycerides (LBXSTR). The
appropriate variable to use for the most accurate data analysis is LBXTR from the TRIGLY_I data file.
Detection Limits
The detection limits were constant for this analyte in the data set. The variable prefixed LBX (ex., LBXTR) provides the analytic result for that analyte.
The lower limit of detection (LLOD, in mg/dL) for triglycerides:
|
Variable Name |
SAS Label |
LLOD |
|
LBXTR |
Serum Triglycerides |
9 |
Please refer to the NHANES Analytic Guidelines and the on-line NHANES Tutorial for further details on the use of sample weights and other analytic issues.
| Code or Value | Value Description | Count | Cumulative | Skip to Item |
|---|---|---|---|---|
| 13612.331812 to<PHONE_NUMBER>3 | Range of Values | 2743 | 2743 | |
| 0 | No Lab Result | 448 | 3191 | |
| . | Missing | 0 | 3191 |
| Code or Value | Value Description | Count | Cumulative | Skip to Item |
|---|---|---|---|---|
| 14 to 2141 | Range of Values | 2723 | 2723 | |
| . | Missing | 468 | 3191 |
| Code or Value | Value Description | Count | Cumulative | Skip to Item |
|---|---|---|---|---|
| 0.158 to 24.172 | Range of Values | 2723 | 2723 | |
| . | Missing | 468 | 3191 |
| Code or Value | Value Description | Count | Cumulative | Skip to Item |
|---|---|---|---|---|
| 23 to 277 | Range of Values | 2699 | 2699 | |
| . | Missing | 492 | 3191 |
| Code or Value | Value Description | Count | Cumulative | Skip to Item |
|---|---|---|---|---|
| 0.595 to 7.163 | Range of Values | 2699 | 2699 | |
| . | Missing | 492 | 3191 |


--- layout: page title: Seminars subtitle: Do something you like. permalink: /seminars/ ---
Existing methods such as t-tests fails to efficiently compare more than two populations. ANOVA efficiently compares two or more populations. The tool is also used to test hypothesis. The seminar talk about few concepts - Hypothesis Testing, Null Hypothesis Test, Confidence Interval and F-Ratio before diving deep into the theory of ANOVA. A short introduction is given to types of ANOVA, One-Way ANOVA, Two-Way ANOVA and MANOVA while One-Way ANOVA is explained with an elucidated example.
Lack of support for inter-GPU communication from existing Training libraries and the modifications required to enable the feature being significant and complicated led to the inception of horovod. It employs efficient inter-GPU Communication using ring-reduce with construct of higher level APIs. The presentation focuses on the Parallelism Techniques, Parameter-Server Architecture and issues with Distributed Tensorflow. Later the focus shifts towards the solution - Execution of Ring-Reduce Algorithm with the use of Message-Passing-Interface.


The E-PORTALis a web development project made for the organisation Community of Coders as a first year summer's project. This website is designed to provide information regarding various educational institutions across India. Our goal is to provide a platform of all the information required for you to take admission in the institution best fit for you. Education is an crucial investment and we look forward to prvide the beutoplayst support we can give.


We back!
So, yeah, its been a while since I wrote something and there are reasons for that. But anyway I wan’t to continue blogging somewhat regularly (one-two times a week) and here is my status update on what happened for last… let me check… two with a half month, damn.
What happened?
i.e. why I was dry for such long period of time
- I quit my last job because it was horrible and I don’t even want to start about that (maybe someday). And it was (job, not the quitting) actually main reason why I started to write something here. Also I had plenty of free time and I could allow to myself to write a lot of non work related code and read a lot about programming/development during working hours.
- And of course I found new job which is much more fun and seems to be pretty cool place to work. And that means that I have now much less time and
and not so much motivation to write/read/code something in my spare time.
 But everything is good right now, so it won’t be a trouble anymore. At least I hope so.
- Also starting from december I renewed my trainings in full speed, which means, again, that I have less time and energy for all the coding stuff.
Whats next?
i.e. plans for nearest future
- Revisit
go
, write some code, form an opinion about it again and decide maybe to switch to it as a main language, because I’m pretty sick with python for some time already. I think I’d better write about that in another post.
- I’m gonna do little online course on
erlang
(it starts in a week and 3 weeks long) and learn a little bit about that, just to be somewhat familiar with it, which I wanted to do for quiet some time.
- Also starting from 20th of March I’ll participate offline course on algorithms and datastructures with
lisp
(yeah, I mean it), which promises to be awesome and hard and motivating and inspiring and tons of other things. I have big plans for that course and I’ll try my best and even to write something about that as well here.
clojure
, yes, what about that? With my new job I had a lot of python3 with async stuff thats why I had to step aside from clojure
for a while. Also I’ve had some serious thoughts on if I should seriously consider it as my “next big thing” or better stick with more “simpler” languages as go
for example. I have some reasons for that, which I describe in post why I’m not comfy with python anymore. But anyway, during this lisp
course I want to decide for myself if I’m ok with lisp dialects and functional languages in general and if I should stick with them for future. We’ll see.
- Comeback to regular non work related coding (again, at least one-two times per week) in any form - daily programmer, exercism, codewars, whatever. In any non python language - clojure, go, lisp (?), erlang (?) we’ll see.
This Blog
i.e. what I’ll be writing about next and what will be the format
- Weekly feature stuff is good as gone, simply because it was an experiment which ended and it was actually successful. By that I mean that I learned that I was reading tons of stuff just because I was bored at work and now its not like that. I’m reading much less - somewhere about 4-5 articles per week, so I see no reason to write separate post about that. I’m planning to write about only very interesting stuff which inspires me and makes me want to try something and write about that. Simple as it gets.
- Coding/programming stuff will comeback, but I don’t know yet in what form and language.
- As I said previously, main goal is to start writing again regularly - one-two times per week and it doesn’t matter whats the topic will be - programming problems, interesting development readings or some experiments.
I think thats for today, and see You next time. I hope it will be soon.


I don't have a very clear memory of the first time I used the internet. What I do remember was that I absolutely fell in love with the idea of playing games online when I discovered the internet. I loved how colourful everything was and I loved how I get to move the characters around myself.
My father would get upset if he saw us playing for a long time because the internet was very expensive at that time. I remember that power puff girls and barbie dress up were my most favourite games.
I can remember quite well the first time that I used the web since I was actually waiting for finally "getting installed the internet” on my computer.
It was in 2000 and I had to dial in via a modem (I'm old enough to remember the pre-flat rate time) and I couldn't wait to create an E-Mail account for being able to send my very first E-Mail to the only other one of my classmates that had Internet already at this time.
Funnily this new way of communication & connecting people that the Internet provided was the most exciting purpose for me and shortly after we discovered the world of chatrooms and were totally amazed of the possibility to talk to people somewhere in real-time.
I got my first computer in 2005. Operation System was Windows XP but the internet very very low speed. Was called Dial-Up modem which made creepy sounds and if someone calling, the internet immediately shot down) After one year, finally we have wi-fi router. One friend told me Microsoft introduced a new operation system Windows 7. I looked in Microsoft website (and yes it was my first web site) and I saw that Microsoft offers to download a new Windows Media Player free. It took me almost 4 hours to get the .exe file. When I installed NEW WMP. That was a very different design from Windows XP and I liked it. At that moment I realized that web it's powerful “tool”.
My first experience using the internet is most likely a relatable one. I was in school, in Paris, and the teacher brought the entire class up to the computer room. I can't remember if the computers were just installed or if it was just the first time we where allowed to use them but I do recall that one particular student had some previous knowledge, mainly due to the fact that he knew how to bypass the school block and was able to get us straight to the most exciting games website. I remember the walls were orange but I have not the recollection of the computer we where using or what we were supposed to be doing (most likely something less exciting like WolframAlpha or paint). Once we got onto the games website I was blown away by the number of games I could play at my will, it was like an endless supply of fun to me and I was incredibly excited. It was clear at that moment that I had underestimated the internet.
My mother had a Mac in the house which she mainly used to write, and I'm sure we had an internet connection at that time but I had never tried using it. To me, the computer was just a tool for work and there was nothing cool or desirable about that, I had no interest in them whatsoever. This obviously changed when I found all the games. Shooting aliens or just simple platformers… I was hooked.
So that's my first real memory of using one and being excited by one. First, the thrill of being able to bypass the school block on forbidden websites then finding out that there where entire websites filled with thousands of games, my mind was blown.


Clicking the button below will open the Obyte wallet with the ORider chat screen. Once you receive the notification about successful login, come back to the browser, you will be logged in.
Scan the QR code with your mobile Obyte wallet to log in.
Copy the pairing code below and paste it in the "Accept invitation from the other device" screen of your desktop wallet.


Now this is what happened once, in Lapland of the Northern Lights!
The Lapps know that Ulda Fairy Folk carry off children, so Lapp fathers and mothers give their children amulets of silver, brass, or copper, to frighten away the Uldas.
There was once a Lapp Mother, who did not give her baby an amulet. One day she saw that her child was looking funny, and acting funnily.
She knew then that the Uldas had carried off her own child, and had left a changeling.
An old Lapp woman told her:
"You must whip that changeling hard. You must put it in a room by itself"--for the Lapp Mother lived in a house--"and you must set a small plate of porridge on the table, with many spoons. Then see what you shall see!
The Lapp Mother did this.  Then she heard the child say:
I've lived as long as the dwarf birches,
Lived as long as mountain birches,
Never have I seen such doings!
Many spoons and little porridge
Then the Lapp Mother knew for sure, that the child was a changeling. She rushed in and whipped it hard--whipped, and whipped, and whipped--beat, and beat, and beat! Then she locked the changeling in by itself, but first she set some burning lights in the room.
By and by she heard Voices. The Uldas were speaking.
"They have been beating our Old Mother," said the Voices. "We cannot stand that!"
And when the Lapp Mother opened the door and peeped in, there was her own child safe and sound. The Uldas had carried off their Old Mother!
You may be sure that the Lapp Mother, as quick as she could, gave her child a silver amulet. She put a knife in its cradle, and fastened silver buttons and other amulets to the three-stringed band that hung from the top of the cradle to its foot.
That frightened away the Uldas.


But, Widgets!
We started showing non-styled non-widgets because it's important
to realize that custom elements are a primitive. The idea
is not to lock users into a framework, but the opposite, to unleash
creativity.
But it's not fun to start at the bottom, so the Polymer
team is working on a nicely styled widget set to blaze the trail.
Click the drawer button in the upper-left corner.
Notes for the advanced:
The particular custom elements used here are not yet canonical,
they are just examples. A key takeaway is that the underlying
implementations are easily modified without necessarily impacting
the app itself.
For example, these layout tools use absolute positioning. Soon, we will
have superior objects that use, for example, flex-box or CSS grids. Those
improved elements can just drop in.


New room
Delete new room
Play
Pick a room to play or make a new one.
Meet new people in your neighborhood and have fun!


I've played with node in the past but as of the new year I decided to try and make a more concerted effort to get stuck into node properly. I decided to go back to the beginning to try and get a better appreciation for the language so read "JavaScript: The Good Parts by Douglas Crockford". I found that exercise fulfilling and resulted in a few light bulb moments that made some dots join up so I'd recommend reading it if you haven't already.
As I stated earlier I have already played with node in the past using Express and have read quite a bit on node and read many examples but I wanted to write a non-web app as I felt this would give me a better opportunity to get to grips with the language and Node. Using Express allows you to get up and running very quickly without to much head scratching so I felt a standalone script would give me more exposure to things.
During the previous couple of weeks at work I wrote a console app that downloaded zip file from a FTP server, extract the contents, read data in a XML file that was in the zip, do some string matching and upload the zip to another FTP server. I figured this would be a good app to replicate in node so off I went.
After a bit of npm research I found the modules I needed and managed to get to the point of downloading files pretty easily with the below code:
var path = require('path');
var fs = require('fs');
var Promise = require('bluebird');
var Client = require('ftp');
var c = new Client();
var connectionProperties = {
host: "myhost",
user: "myuser",
password: "mypwd"
};
c.on('ready', function () {
console.log('ready');
c.list(function (err, list) {
if (err) throw err;
list.forEach(function (element, index, array) {
//Ignore directories
if (element.type === 'd') {
console.log('ignoring directory ' + element.name);
return;
}
//Ignore non zips
if (path.extname(element.name) !== '.zip') {
console.log('ignoring file ' + element.name);
return;
}
//Download files
c.get(element.name, function (err, stream) {
if (err) throw err;
stream.once('close', function () {
c.end();
});
stream.pipe(fs.createWriteStream(element.name));
});
});
});
});
c.connect(connectionProperties);
However, I originally had that code in a function and wanted to call it and then call another function to read the files that I had downloaded but what I found was callback hell.
I needed to know that all the files had downloaded and then I could read the files in a directory ready for zip extraction but I couldn't work out how. I discovered promises and probably didn't read enough about all the ins and outs of them but I remember Glenn Block giving a talk about async programming in node so I pestered him on Twitter and he kindly helped and me out and also pointed me towards his code and slides where I decided to use Bluebird, the promise library. Unfortunately I just couldn't get the files downloaded. It would download one file but not the other and closed the streams.
Here is a snippet of what I had (brace yourself)
var processListing = function (directoryItems) {
var itemsToDownload = [];
directoryItems.forEach(function (element, index, array) {
//Ignore directories
if (element.type === 'd') {
console.log('directory ' + element.name);
return;
}
//Ignore non zips
if (path.extname(element.name) !== '.zip') {
console.log('ignoring ' + element.name);
return;
}
//Download zip
itemsToDownload.push({
source: element.name,
destination: element.name
});
});
return itemsToDownload;
};
var processItem = function (object) {
return aFtpClient.getAsync(object.source);
};
var downloadFiles = function () {
console.log('downloading files');
aFtpClient.
listAsync().
then(processListing).
map(function (object) {
return processItem(object).then(function (processResult) {
return {
input: object,
result: processResult
};
});
}).
map(function (downloadItem) {
downloadItem.result.pipe(fs.createWriteStream(process.cwd() + "/zips/" + downloadItem.input.destination));
return new Promise(function (resolve, reject) {
downloadItem.result.once("close", function () {
console.log('closed');
resolve();
});
});
}).done()
};
Not only is that a tad complicated but I could not for the life of me understand what the hell was happening and why it wasn't downloading all the files. I reached out to @PrabirShrestha who agreed it was a tad over complicated and tried to help but recommended I take a look at Reactive Extensions, maybe I will in the future but at this point my frustration had kicked in and I wanted to give up. I went through a mixture of emotions from frustration, which led to anger, fuming anger, denial, then apathy. Although these emotions went by and after a couple of questions on stackoverflow that helped but didn't give the solution I explained the issue to a colleague and we both took a look. I went through a few iterations with no luck and after a bit more reading I think we were closing in on it individually but I was beaten to it. All hail @iamnerdfury who produced this:
var connect = function() {
c.connect(connectionProperties);
return c.onAsync('ready');
};
var getList = function() {
return c.listAsync();
};
var zipFiles = function(element) {
return element.type !== 'd' && path.extname(element.name) === '.zip';
};
var current = Promise.resolve();
var downloadFiles = function(file) {
current = current.then(function() {
return c.getAsync(file.name)
}).then(function(stream) {
stream.pipe(fs.createWriteStream(file.name));
console.log(file.name + ' downloaded..');
});
return current;
};
connect().then(getList).filter(zipFiles).map(downloadFiles).done();
I think the previous issues I had was I was returning resolve()
after the first file downloaded which is not what you want to do when multiple calls to it are executed as a promise can only resolve once. I needed to find some way of concatenating a promise somehow for each file that is downloaded. I looked at the all()
command but I couldn't get it to fit but @iamnerdfury found that you could do this via creating an instance of a promise by calling resolve and then assign to it on each file that needed to be downloaded.
Now I know the files are downloaded I can chain more functions to read the file system, extract the zip for each one, read the XML and upload to a new server.
I hope this helps someone else because it wound me up something chronic and whilst I get pissed off with JavaScript when things like this happen I will keep at it because I think node is now becoming a serious contender and us developers need to keep a finger in many pies.
(If you think there is a way to improve the solution above I'd love to hear it)


{% extends "page-layout.html" %} {% block content %}
Couldn’t authenticate with Github, sorry: {{reason}}


Menu
Click the left side. Then, you can control the character.
Click the right side. Then, you can control the camera.
Walk Speed
Slow
Medium
Fast
Game Start
Again Same Stage
Next Stage
All Reset


For the simplest deployment, create a production build and copy the output directory to a web server.
1. Start with the production build:
2. Copy everything within the output folder (dist/
by default) to a folder on the server.
3. Configure the server to redirect requests for missing files to index.html
Angular offers two ways to compile your application:
Just-in-Time (JIT), which compiles your app in the browser at runtime.
Ahead-of-Time (AOT), which compiles your app at build time.
JIT compilation is the default when you run the ng build (build only) or ng serve (build and serve locally) CLI commands:
For AOT compilation, include the --aot option with the ng build or ng serve command:
The ng build command with the --prod meta-flag (ng build --prod) compiles with AOT by default.