public JobDescriptor( String id, String conicalPath, String fullpath, Props props, ClassLoader classLoader) { this._id = id; this._path = conicalPath; this._fullpath = fullpath; this._props = PropsUtils.resolveProps(props); this._jobType = props.getString(JOB_TYPE, ""); // @TODO Move this validation check in Java Job // if(_jobType.length() == 0 || _jobType.equalsIgnoreCase("java")) { // String className = props.getString(JOB_CLASS); // this._class = Utils.loadClass(className, classLoader); // } this._readResourceLocks = props.getStringList(READ_LOCKS, ","); this._dependencies = new HashSet<JobDescriptor>(); this._retries = props.getInt(RETRIES, 0); this._retryBackoffMs = props.getLong(RETRY_BACKOFF, 0); this._requiredPermits = props.getInt(JOB_PERMITS, 0); this._classLoader = classLoader; this._writeResourceLocks = props.getStringList(WRITE_LOCKS, ","); this._sourceEmailList = props.getString("mail.sender", null); // Ordered resource locking should help prevent simple deadlocking // situations. Collections.sort(this._readResourceLocks); Collections.sort(this._writeResourceLocks); this._emailList = props.getStringList(NOTIFY_EMAIL); }
public void runPushStore(Props props, String url, String dataDir) throws Exception { // For backwards compatibility http timeout = admin timeout int httpTimeoutMs = 1000 * props.getInt("push.http.timeout.seconds", 24 * 60 * 60); long pushVersion = props.getLong("push.version", -1L); if (props.containsKey("push.version.timestamp")) { DateFormat format = new SimpleDateFormat("yyyyMMddHHmmss"); pushVersion = Long.parseLong(format.format(new Date())); } int maxBackoffDelayMs = 1000 * props.getInt("push.backoff.delay.seconds", 60); boolean rollback = props.getBoolean("push.rollback", true); new VoldemortSwapJob( this.getId() + "-push-store", props, new VoldemortSwapConf( cluster, dataDir, storeName, httpTimeoutMs, pushVersion, maxBackoffDelayMs, rollback)) .run(); }