Class MySQLBatchFetcher fetches data from an app MySQL database using a query.
| package |
PhpDruidIngest\Fetcher |
|---|
fetch() : array|mixed
| throws | |
|---|---|
array|mixed
getMysqli( $host, $user, $pass, $db) : \mysqli
\mysqli
getOutput() : \Psr\Log\LoggerInterface
\Psr\Log\LoggerInterface
prepareQuery(String $query, String $start, String $end) : String
StringQuery with {STARTDATE} and {ENDDATE} for value substituion
StringISO Date Time string
StringISO Date Time string
StringPrepared query string
processRow( $row) : mixed
mixed
setIntervals(string $intervalStart = "1970-01-01 01:30:00", string $intervalEnd = "3030-01-01 01:30:00")
string
string
setMySqlCredentials( $host, $user, $pass, $db)
setOutput(\Psr\Log\LoggerInterface $output)
\Psr\Log\LoggerInterface
setTimeWindow(string $start, string $end) : string
stringISO DateTime for start of ingestion window
stringISO DateTime for end of ingestion window
string
query : string
The parameters are inserted via string replacement: {STARTDATE} and {ENDDATE}
An example template: "SELECT id FROM things WHERE date BETWEEN '{STARTDATE}' AND '{ENDDATE}';"
| var |
|---|
string
host :
user :
pass :
db :
output : \Psr\Log\LoggerInterface
| var |
|---|
\Psr\Log\LoggerInterface