mirror of https://github.com/citusdata/citus.git
Use better naming
parent
14e71b1b0a
commit
31ab5012fd
|
@ -125,7 +125,7 @@ static void OpenCopyTransactions(CopyStmt *copyStatement,
|
|||
ShardConnections *shardConnections,
|
||||
int64 shardId);
|
||||
static StringInfo ConstructCopyStatement(CopyStmt *copyStatement, int64 shardId);
|
||||
static void SendCopyDataToPlacements(StringInfo lineBuf,
|
||||
static void SendCopyDataToPlacements(StringInfo dataBuffer,
|
||||
ShardConnections *shardConnections);
|
||||
static List * ConnectionList(HTAB *connectionHash);
|
||||
static void EndRemoteCopy(List *connectionList, bool stopOnFailure);
|
||||
|
@ -361,13 +361,13 @@ CitusCopyFrom(CopyStmt *copyStatement, char *completionTag)
|
|||
|
||||
OpenCopyTransactions(copyStatement, shardConnections, shardId);
|
||||
|
||||
CopySendBinaryHeaders(copyOutState);
|
||||
BuildCopyBinaryHeaders(copyOutState);
|
||||
SendCopyDataToPlacements(copyOutState->fe_msgbuf, shardConnections);
|
||||
}
|
||||
|
||||
/* Replicate row to all shard placements */
|
||||
CopySendRow(columnValues, columnNulls, tupleDescriptor, copyOutState,
|
||||
columnOutputFunctions);
|
||||
BuildCopyRowData(columnValues, columnNulls, tupleDescriptor,
|
||||
copyOutState, columnOutputFunctions);
|
||||
SendCopyDataToPlacements(copyOutState->fe_msgbuf, shardConnections);
|
||||
|
||||
processedRowCount += 1;
|
||||
|
@ -379,7 +379,7 @@ CitusCopyFrom(CopyStmt *copyStatement, char *completionTag)
|
|||
shardConnections = (ShardConnections *) hash_seq_search(&status);
|
||||
while (shardConnections != NULL)
|
||||
{
|
||||
CopySendBinaryFooters(copyOutState);
|
||||
BuildCopyBinaryFooters(copyOutState);
|
||||
SendCopyDataToPlacements(copyOutState->fe_msgbuf, shardConnections);
|
||||
|
||||
shardConnections = (ShardConnections *) hash_seq_search(&status);
|
||||
|
@ -732,7 +732,7 @@ ConstructCopyStatement(CopyStmt *copyStatement, int64 shardId)
|
|||
* a shard.
|
||||
*/
|
||||
static void
|
||||
SendCopyDataToPlacements(StringInfo lineBuf, ShardConnections *shardConnections)
|
||||
SendCopyDataToPlacements(StringInfo dataBuffer, ShardConnections *shardConnections)
|
||||
{
|
||||
ListCell *connectionCell = NULL;
|
||||
foreach(connectionCell, shardConnections->connectionList)
|
||||
|
@ -743,7 +743,7 @@ SendCopyDataToPlacements(StringInfo lineBuf, ShardConnections *shardConnections)
|
|||
int64 shardId = shardConnections->shardId;
|
||||
|
||||
/* copy the line buffer into the placement */
|
||||
int copyResult = PQputCopyData(connection, lineBuf->data, lineBuf->len);
|
||||
int copyResult = PQputCopyData(connection, dataBuffer->data, dataBuffer->len);
|
||||
if (copyResult != 1)
|
||||
{
|
||||
char *nodeName = ConnectionGetOptionValue(connection, "host");
|
||||
|
@ -911,7 +911,7 @@ ColumnOutputFunctions(TupleDesc rowDescriptor, bool binaryFormat)
|
|||
|
||||
|
||||
/*
|
||||
* CopySendRow serializes one row using the column output functions,
|
||||
* BuildCopyRowData serializes one row using the column output functions,
|
||||
* and appends the data to the row output state object's message buffer.
|
||||
* This function is modeled after the CopyOneRowTo() function in
|
||||
* commands/copy.c, but only implements a subset of that functionality.
|
||||
|
@ -919,7 +919,7 @@ ColumnOutputFunctions(TupleDesc rowDescriptor, bool binaryFormat)
|
|||
* to not bloat memory usage.
|
||||
*/
|
||||
void
|
||||
CopySendRow(Datum *valueArray, bool *isNullArray, TupleDesc rowDescriptor,
|
||||
BuildCopyRowData(Datum *valueArray, bool *isNullArray, TupleDesc rowDescriptor,
|
||||
CopyOutState rowOutputState, FmgrInfo *columnOutputFunctions)
|
||||
{
|
||||
MemoryContext oldContext = NULL;
|
||||
|
@ -997,7 +997,7 @@ CopySendRow(Datum *valueArray, bool *isNullArray, TupleDesc rowDescriptor,
|
|||
|
||||
/* Append binary headers to the copy buffer in headerOutputState. */
|
||||
void
|
||||
CopySendBinaryHeaders(CopyOutState headerOutputState)
|
||||
BuildCopyBinaryHeaders(CopyOutState headerOutputState)
|
||||
{
|
||||
const int32 zero = 0;
|
||||
|
||||
|
@ -1016,7 +1016,7 @@ CopySendBinaryHeaders(CopyOutState headerOutputState)
|
|||
|
||||
/* Append binary footers to the copy buffer in footerOutputState. */
|
||||
void
|
||||
CopySendBinaryFooters(CopyOutState footerOutputState)
|
||||
BuildCopyBinaryFooters(CopyOutState footerOutputState)
|
||||
{
|
||||
int16 negative = -1;
|
||||
|
||||
|
|
|
@ -814,8 +814,8 @@ FilterAndPartitionTable(const char *filterQuery,
|
|||
/* deconstruct the tuple; this is faster than repeated heap_getattr */
|
||||
heap_deform_tuple(row, rowDescriptor, valueArray, isNullArray);
|
||||
|
||||
CopySendRow(valueArray, isNullArray, rowDescriptor, rowOutputState,
|
||||
columnOutputFunctions);
|
||||
BuildCopyRowData(valueArray, isNullArray, rowDescriptor,
|
||||
rowOutputState, columnOutputFunctions);
|
||||
rowText = rowOutputState->fe_msgbuf;
|
||||
|
||||
partitionFile = partitionFileArray[partitionId];
|
||||
|
@ -973,7 +973,7 @@ OutputBinaryHeaders(FileOutputStream *partitionFileArray, uint32 fileCount)
|
|||
memset(headerOutputState, 0, sizeof(CopyOutStateData));
|
||||
headerOutputState->fe_msgbuf = makeStringInfo();
|
||||
|
||||
CopySendBinaryHeaders(headerOutputState);
|
||||
BuildCopyBinaryHeaders(headerOutputState);
|
||||
|
||||
partitionFile = partitionFileArray[fileIndex];
|
||||
FileOutputStreamWrite(partitionFile, headerOutputState->fe_msgbuf);
|
||||
|
@ -999,7 +999,7 @@ OutputBinaryFooters(FileOutputStream *partitionFileArray, uint32 fileCount)
|
|||
memset(footerOutputState, 0, sizeof(CopyOutStateData));
|
||||
footerOutputState->fe_msgbuf = makeStringInfo();
|
||||
|
||||
CopySendBinaryFooters(footerOutputState);
|
||||
BuildCopyBinaryFooters(footerOutputState);
|
||||
|
||||
partitionFile = partitionFileArray[fileIndex];
|
||||
FileOutputStreamWrite(partitionFile, footerOutputState->fe_msgbuf);
|
||||
|
|
|
@ -46,10 +46,10 @@ typedef struct CopyOutStateData *CopyOutState;
|
|||
|
||||
/* function declarations for copying into a distributed table */
|
||||
extern FmgrInfo * ColumnOutputFunctions(TupleDesc rowDescriptor, bool binaryFormat);
|
||||
extern void CopySendRow(Datum *valueArray, bool *isNullArray, TupleDesc rowDescriptor,
|
||||
extern void BuildCopyRowData(Datum *valueArray, bool *isNullArray, TupleDesc rowDescriptor,
|
||||
CopyOutState rowOutputState, FmgrInfo *columnOutputFunctions);
|
||||
extern void CopySendBinaryHeaders(CopyOutState headerOutputState);
|
||||
extern void CopySendBinaryFooters(CopyOutState footerOutputState);
|
||||
extern void BuildCopyBinaryHeaders(CopyOutState headerOutputState);
|
||||
extern void BuildCopyBinaryFooters(CopyOutState footerOutputState);
|
||||
extern void CitusCopyFrom(CopyStmt *copyStatement, char *completionTag);
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue