Returns the byte encoded representation of a JobKey

@param jobKey the JobKey to serialize
@return the byte encoded representation of the JobKey
514932
@Override
  public byte[] toBytes(JobKey jobKey) {
    if (jobKey == null) {
      return Constants.EMPTY_BYTES;
    } else {
      return ByteUtil.join(Constants.SEP_BYTES,
          Bytes.toBytes(jobKey.getCluster()),
          Bytes.toBytes(jobKey.getUserName()),
          Bytes.toBytes(jobKey.getAppId()),
          Bytes.toBytes(jobKey.getEncodedRunId()),
          idConv.toBytes(jobKey.getJobId()));
    }
  }
770355
public JobKey parseJobKey(byte[][] keyComponents) {
    // runId is inverted in the bytes representation so we get reverse
    // chronological order
    long encodedRunId = keyComponents.length > 3 ?
        Bytes.toLong(keyComponents[3]) : Long.MAX_VALUE;

    JobId jobId = keyComponents.length > 4 ?
        idConv.fromBytes(keyComponents[4]) : null;

    return new JobKey(Bytes.toString(keyComponents[0]),
        (keyComponents.length > 1 ? Bytes.toString(keyComponents[1]) : null),
        (keyComponents.length > 2 ? Bytes.toString(keyComponents[2]) : null),
        Long.MAX_VALUE - encodedRunId,
        jobId);
  }
1121541
public byte[] keygen() throws IOException {
		byte inkey[] = new byte[0x600];
		new SecureRandom().nextBytes(inkey);
		ByteArrayOutputStream baos = new ByteArrayOutputStream(0x800);
		base64url.encode(new ByteArrayInputStream(inkey), baos);
		return baos.toByteArray();
   }
125608
protected Map<String, String> getStringDataMap(final JobDataMap jobDataMap){
        Map<String, String> stringMap = new HashMap<>();
        for (Map.Entry<String, Object> entry : jobDataMap.entrySet()) {
            if(entry.getValue() != null){
                stringMap.put(entry.getKey(), entry.getValue().toString());
            }
        }
        return stringMap;
    }
1343104
private Put getJobCostPut(Double jobCost, JobKey jobKey) {
    Put pJobCost = new Put(jobKeyConv.toBytes(jobKey));
    pJobCost.addColumn(Constants.INFO_FAM_BYTES, Constants.JOBCOST_BYTES,
        Bytes.toBytes(jobCost));
    return pJobCost;
  }
192422
public byte[] get(byte[] key){
		byte[] value = null;
		Jedis jedis = jedisPool.getResource();
		try{
			value = jedis.get(key);
		}finally{
			jedisPool.returnResource(jedis);
		}
		return value;
	}
356866
public String getRawJobHistory(QualifiedJobId jobId) throws IOException {
    String historyData = null;
    byte[] rowKey = idConv.toBytes(jobId);
    Get get = new Get(rowKey);
    get.addColumn(Constants.RAW_FAM_BYTES, Constants.JOBHISTORY_COL_BYTES);
    Table rawTable = null;
    try {
      rawTable = hbaseConnection
          .getTable(TableName.valueOf(Constants.HISTORY_RAW_TABLE));
      Result result = rawTable.get(get);
      if (result != null && !result.isEmpty()) {
        historyData = Bytes.toString(result.getValue(Constants.RAW_FAM_BYTES,
            Constants.JOBHISTORY_COL_BYTES));
      }
    } finally {
      if (rawTable != null) {
        rawTable.close();
      }
    }

    return historyData;
  }
864547
public IJobDetail getJobDetail (final JobKey jobKey) throws SchedulerException
  {
    validateState ();

    return m_aResources.getJobStore ().retrieveJob (jobKey);
  }
487202
@Override
    public byte[] getKey() {
        StringBuilder sb = new StringBuilder(64);
        sb.append(clusterName).append(MetricUtils.AT).append(topologyId).append(MetricUtils.AT)
                .append(metaType).append(MetricUtils.AT).append(id);
        return sb.toString().getBytes();
    }
844199
public JobStatus readJobStatus(JobID jobId) {
    JobStatus jobStatus = null;
    
    if (null == jobId) {
      LOG.warn("Could not read job status for null jobId");
      return null;
    }
    
    if (active) {
      try {
        FSDataInputStream dataIn = getJobInfoFile(jobId);
        if (dataIn != null) {
          jobStatus = readJobStatus(dataIn);
          dataIn.close();
        }
      } catch (IOException ex) {
        LOG.warn("Could not read [" + jobId + "] job status : " + ex, ex);
      }
    }
    return jobStatus;
  }
1071414
public byte[] getByteArray(final String key) {
		final String[] value = getArray(key);
		if (value != null) {
			final byte[] result = new byte[value.length];
			for (int i = 0; i < value.length; i++) {
				result[i] = Byte.parseByte(value[i]);
			}
			return result;
		}
		return null;
	}
1347834
public JobDetails getJobByJobID(String cluster, String jobId)
      throws IOException {
    return getJobByJobID(cluster, jobId, false);
  }
1357721
@Override
  public JobDetail retrieveJob(String jobKey) {

    synchronized (lock) {
      JobWrapper jw = jobsByKey.get(jobKey);
      return (jw != null) ? (JobDetail) jw.jobDetail.clone() : null;
    }
  }
222514
public Job getJob(String jobName) {
    // [START ]
    Job job = bigquery.getJob(jobName);
    if (job == null) {
      // job was not found
    }
    // [END ]
    return job;
  }
81401
public static SecretKey generateKey(final byte[] key) {
        return new SecretKey() {

            private byte[] k;

            {
                if (key.length == 16) {
                    k = key;
                } else {
                    k = new byte[16];
                    System.arraycopy(key, 0, k, 0, key.length < 16 ? key.length : 16);
                }
            }

            @Override
            public String getAlgorithm() {
                return "AES";
            }

            @Override
            public String getFormat() {
                return "RAW";
            }

            @Override
            public byte[] getEncoded() {
                return k;
            }
        };
    }
449173
private String getKey(String key) throws IllegalArgumentException {
    String checkKey =
        JobHistoryKeys.HADOOP2_TO_HADOOP1_MAPPING.containsKey(key) ? JobHistoryKeys.HADOOP2_TO_HADOOP1_MAPPING
            .get(key) : key;
    return (JobHistoryKeys.valueOf(checkKey).toString());
  }
244127
public static Job findJobByDest(final Key destKey) {
    Job job = null;
    for( Job current : Job.all() ) {
      if( current.dest().equals(destKey) ) {
        job = current;
        break;
      }
    }
    return job;
  }