update the constant name to HDFS_URN_PREFIX_LEN and put comment

This commit is contained in:
jbai 2016-03-18 18:02:03 -07:00
parent 45a2a57715
commit 9552aae34b
3 changed files with 4 additions and 4 deletions

View File

@ -41,7 +41,7 @@ public class DatasetRowMapper implements RowMapper<Dataset>
public static String DATASET_OWNER_NAME_COLUMN = "owner_name";
public static String SCHEMA_HISTORY_ID_COLUMN = "schema_history_id";
public static String HDFS_PREFIX = "hdfs";
public static int URN_PREFIX_LEN = 7;
public static int HDFS_URN_PREFIX_LEN = 7; //for hdfs prefix is hdfs:///, but we need the last slash
@Override
@ -103,7 +103,7 @@ public class DatasetRowMapper implements RowMapper<Dataset>
if (dataset.urn.substring(0, 4).equalsIgnoreCase(HDFS_PREFIX))
{
dataset.hdfsBrowserLink = Play.application().configuration().getString(DatasetsDAO.HDFS_BROWSER_URL_KEY) +
dataset.urn.substring(URN_PREFIX_LEN);
dataset.urn.substring(HDFS_URN_PREFIX_LEN);
}
}
dataset.source = source;

View File

@ -106,7 +106,7 @@ public class DatasetWithUserRowMapper implements RowMapper<Dataset>
if (dataset.urn.substring(0, 4).equalsIgnoreCase(HDFS_PREFIX))
{
dataset.hdfsBrowserLink = Play.application().configuration().getString(DatasetsDAO.HDFS_BROWSER_URL_KEY) +
dataset.urn.substring(DatasetRowMapper.URN_PREFIX_LEN);
dataset.urn.substring(DatasetRowMapper.HDFS_URN_PREFIX_LEN);
}
}
dataset.source = source;

View File

@ -455,7 +455,7 @@ public class DatasetsDAO extends AbstractMySQLOpenSourceDAO
if (ds.urn.substring(0, 4).equalsIgnoreCase(DatasetRowMapper.HDFS_PREFIX))
{
ds.hdfsBrowserLink = Play.application().configuration().getString(HDFS_BROWSER_URL_KEY) +
ds.urn.substring(DatasetRowMapper.URN_PREFIX_LEN);
ds.urn.substring(DatasetRowMapper.HDFS_URN_PREFIX_LEN);
}
}
if (favoriteId != null && favoriteId > 0)