Skip to content
This repository has been archived by the owner on Jan 15, 2022. It is now read-only.

Commit

Permalink
Eliminating the various _TABLE_BYTES and using strings instead. (#153)
Browse files Browse the repository at this point in the history
Thanks!
  • Loading branch information
jrottinghuis authored and sjlee committed Oct 15, 2016
1 parent 6f50812 commit 1ab9d72
Show file tree
Hide file tree
Showing 9 changed files with 311 additions and 318 deletions.
11 changes: 1 addition & 10 deletions hraven-core/src/main/java/com/twitter/hraven/Constants.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2012 Twitter, Inc.
Copyright 2016 Twitter, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -46,24 +46,15 @@ public class Constants {

/* **** Table names **** */
public static String HISTORY_TABLE = PREFIX + "job_history";
public static byte[] HISTORY_TABLE_BYTES = Bytes.toBytes(HISTORY_TABLE);

public static String HISTORY_TASK_TABLE = HISTORY_TABLE + "_task";
public static byte[] HISTORY_TASK_TABLE_BYTES = Bytes
.toBytes(HISTORY_TASK_TABLE);

public static String HISTORY_BY_JOBID_TABLE = HISTORY_TABLE + "-by_jobId";
public static byte[] HISTORY_BY_JOBID_TABLE_BYTES = Bytes
.toBytes(HISTORY_BY_JOBID_TABLE);

public static String HISTORY_APP_VERSION_TABLE = HISTORY_TABLE
+ "_app_version";
public static byte[] HISTORY_APP_VERSION_TABLE_BYTES = Bytes
.toBytes(HISTORY_APP_VERSION_TABLE);

public static String HISTORY_RAW_TABLE = HISTORY_TABLE + "_raw";
public static byte[] HISTORY_RAW_TABLE_BYTES = Bytes
.toBytes(HISTORY_RAW_TABLE);

public static final String JOB_FILE_PROCESS_TABLE = PREFIX
+ "job_history_process";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2012 Twitter, Inc.
Copyright 2016 Twitter, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -34,7 +34,7 @@

/**
* Service to access the {@link Constants#HISTORY_BY_JOBID_TABLE}.
*
*
*/
public class JobHistoryByIdService {
private static Log LOG = LogFactory.getLog(HdfsStatsService.class);
Expand Down Expand Up @@ -68,7 +68,7 @@ public JobHistoryByIdService(Configuration hbaseConf) throws IOException {

conn = ConnectionFactory.createConnection(conf);
historyByJobIdTable = conn.getTable(
TableName.valueOf(Constants.HISTORY_BY_JOBID_TABLE_BYTES));
TableName.valueOf(Constants.HISTORY_BY_JOBID_TABLE));
}

/**
Expand Down Expand Up @@ -125,7 +125,7 @@ public JobKey getJobKeyById(QualifiedJobId jobId) throws IOException {

/**
* Create the secondary indexes records cluster!jobId->jobKey.
*
*
* @param jobKey
* @throws IOException
* if the entry cannot be written.
Expand Down

0 comments on commit 1ab9d72

Please sign in to comment.