K
- Key typeV
- Value typepublic abstract class AbstractBigQueryInputFormat<K,V> extends org.apache.hadoop.mapreduce.InputFormat<K,V> implements DelegateRecordReaderFactory<K,V>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
EXTERNAL_TABLE_TYPE
The keyword for the type of BigQueryTable store externally.
|
static java.lang.String |
INPUT_FORMAT_CLASS_KEY
Configuration key for InputFormat class name.
|
Constructor and Description |
---|
AbstractBigQueryInputFormat() |
Modifier and Type | Method and Description |
---|---|
static void |
cleanupJob(BigQueryHelper bigQueryHelper,
org.apache.hadoop.conf.Configuration config)
Similar to
cleanupJob(JobContext) , but allows specifying the Bigquery instance to use. |
static void |
cleanupJob(org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.mapreduce.JobID jobId)
Cleans up relevant temporary resources associated with a job which used the
GsonBigQueryInputFormat; this should be called explicitly after the completion of the entire
job.
|
static void |
cleanupJob(org.apache.hadoop.mapreduce.JobContext context)
Deprecated.
|
org.apache.hadoop.mapreduce.RecordReader<K,V> |
createRecordReader(org.apache.hadoop.mapreduce.InputSplit inputSplit,
org.apache.hadoop.conf.Configuration configuration) |
org.apache.hadoop.mapreduce.RecordReader<K,V> |
createRecordReader(org.apache.hadoop.mapreduce.InputSplit inputSplit,
org.apache.hadoop.mapreduce.TaskAttemptContext taskAttemptContext) |
protected com.google.api.services.bigquery.Bigquery |
getBigQuery(org.apache.hadoop.conf.Configuration config)
Helper method to override for testing.
|
protected BigQueryHelper |
getBigQueryHelper(org.apache.hadoop.conf.Configuration config)
Helper method to override for testing.
|
abstract ExportFileFormat |
getExportFileFormat()
Get the ExportFileFormat that this input format supports.
|
protected static ExportFileFormat |
getExportFileFormat(java.lang.Class<? extends AbstractBigQueryInputFormat<?,?>> clazz) |
protected static ExportFileFormat |
getExportFileFormat(org.apache.hadoop.conf.Configuration configuration) |
java.util.List<org.apache.hadoop.mapreduce.InputSplit> |
getSplits(org.apache.hadoop.mapreduce.JobContext context) |
protected static boolean |
isShardedExportEnabled(org.apache.hadoop.conf.Configuration configuration) |
static void |
setEnableShardedExport(org.apache.hadoop.conf.Configuration configuration,
boolean enabled)
Enable or disable BigQuery sharded output.
|
static void |
setInputTable(org.apache.hadoop.conf.Configuration configuration,
java.lang.String projectId,
java.lang.String datasetId,
java.lang.String tableId)
Configure the BigQuery input table for a job
|
static void |
setInputTable(org.apache.hadoop.conf.Configuration configuration,
com.google.api.services.bigquery.model.TableReference tableReference)
Configure the BigQuery input table for a job
|
static void |
setTemporaryCloudStorageDirectory(org.apache.hadoop.conf.Configuration configuration,
java.lang.String path)
Configure a directory to which we will export BigQuery data
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createDelegateRecordReader
public static final java.lang.String INPUT_FORMAT_CLASS_KEY
public static final java.lang.String EXTERNAL_TABLE_TYPE
public static void setInputTable(org.apache.hadoop.conf.Configuration configuration, java.lang.String projectId, java.lang.String datasetId, java.lang.String tableId) throws java.io.IOException
java.io.IOException
public static void setInputTable(org.apache.hadoop.conf.Configuration configuration, com.google.api.services.bigquery.model.TableReference tableReference) throws java.io.IOException
java.io.IOException
public static void setTemporaryCloudStorageDirectory(org.apache.hadoop.conf.Configuration configuration, java.lang.String path)
public static void setEnableShardedExport(org.apache.hadoop.conf.Configuration configuration, boolean enabled)
protected static boolean isShardedExportEnabled(org.apache.hadoop.conf.Configuration configuration)
public abstract ExportFileFormat getExportFileFormat()
public java.util.List<org.apache.hadoop.mapreduce.InputSplit> getSplits(org.apache.hadoop.mapreduce.JobContext context) throws java.io.IOException, java.lang.InterruptedException
public org.apache.hadoop.mapreduce.RecordReader<K,V> createRecordReader(org.apache.hadoop.mapreduce.InputSplit inputSplit, org.apache.hadoop.mapreduce.TaskAttemptContext taskAttemptContext) throws java.io.IOException, java.lang.InterruptedException
public org.apache.hadoop.mapreduce.RecordReader<K,V> createRecordReader(org.apache.hadoop.mapreduce.InputSplit inputSplit, org.apache.hadoop.conf.Configuration configuration) throws java.io.IOException, java.lang.InterruptedException
java.io.IOException
java.lang.InterruptedException
@Deprecated public static void cleanupJob(org.apache.hadoop.mapreduce.JobContext context) throws java.io.IOException
cleanupJob(Configuration, JobID)
context
- The JobContext which contains the full configuration plus JobID which matches
the JobContext seen in the corresponding BigQueryInptuFormat.getSplits() setup.java.io.IOException
public static void cleanupJob(org.apache.hadoop.conf.Configuration configuration, org.apache.hadoop.mapreduce.JobID jobId) throws java.io.IOException
java.io.IOException
public static void cleanupJob(BigQueryHelper bigQueryHelper, org.apache.hadoop.conf.Configuration config) throws java.io.IOException
cleanupJob(JobContext)
, but allows specifying the Bigquery instance to use.bigQueryHelper
- The Bigquery API-client helper instance to use.config
- The job Configuration object which contains settings such as whether sharded
export was enabled, which GCS directory the export was performed in, etc.java.io.IOException
protected static ExportFileFormat getExportFileFormat(org.apache.hadoop.conf.Configuration configuration)
protected static ExportFileFormat getExportFileFormat(java.lang.Class<? extends AbstractBigQueryInputFormat<?,?>> clazz)
protected com.google.api.services.bigquery.Bigquery getBigQuery(org.apache.hadoop.conf.Configuration config) throws java.security.GeneralSecurityException, java.io.IOException
java.io.IOException
- on IO Error.java.security.GeneralSecurityException
- on security exception.protected BigQueryHelper getBigQueryHelper(org.apache.hadoop.conf.Configuration config) throws java.security.GeneralSecurityException, java.io.IOException
java.security.GeneralSecurityException
java.io.IOException
Copyright © 2018. All rights reserved.