示例#1
0
void
AppendOnlyStorageFormat_LogSmallContentHeader(
	uint8			*headerPtr,
	bool			usingChecksums,
	int				version)
{
	char *str;

	str = AppendOnlyStorageFormat_SmallContentHeaderStr(
												headerPtr,
												usingChecksums,
												version);

	elog(LOG, "%s", str);

	pfree(str);
}
示例#2
0
/*
 * errdetail_appendonly_storage_smallcontent_header
 *
 * Add an errdetail() line showing the Append-Only Storage block header.
 */
int
errdetail_appendonly_storage_smallcontent_header(
	uint8	*headerPtr,
	bool	usingChecksums,
	int		version)
{
	char *str;

	str = AppendOnlyStorageFormat_SmallContentHeaderStr(
												headerPtr,
												usingChecksums,
												version);

	errdetail("%s", str);

	pfree(str);

	return 0;
}
示例#3
0
static void
AppendOnlyStorageRead_LogBlockHeader(AppendOnlyStorageRead *storageRead,
									 uint8 *header)
{
	char	   *contextStr;
	char	   *blockHeaderStr;

	contextStr = AppendOnlyStorageRead_ContextStr(storageRead);

	blockHeaderStr =
		AppendOnlyStorageFormat_SmallContentHeaderStr(header,
									 storageRead->storageAttributes.checksum,
									 storageRead->formatVersion);
	ereport(LOG,
			(errmsg("%s. %s",
					contextStr,
					blockHeaderStr)));

	pfree(contextStr);
	pfree(blockHeaderStr);
}
示例#4
0
char *
AppendOnlyStorageFormat_BlockHeaderStr(
	uint8			*headerPtr,
	bool			usingChecksums,
	int				version)
{
	AOSmallContentHeader 	*blockHeader;

	AoHeaderKind aoHeaderKind;

	char *str;

	blockHeader = (AOSmallContentHeader*)headerPtr;
	aoHeaderKind = AOSmallContentHeaderGet_headerKind(blockHeader);
	switch (aoHeaderKind)
	{
	case AoHeaderKind_SmallContent:
		str = AppendOnlyStorageFormat_SmallContentHeaderStr(
												headerPtr,
												usingChecksums,
												version);
		break;

	case AoHeaderKind_LargeContent:
		str = AppendOnlyStorageFormat_LargeContentHeaderStr(
												headerPtr,
												usingChecksums,
												version);
		break;

	case AoHeaderKind_NonBulkDenseContent:
		str = AppendOnlyStorageFormat_NonBulkDenseContentHeaderStr(
												headerPtr,
												usingChecksums,
												version);
		break;

	case AoHeaderKind_BulkDenseContent:
		str = AppendOnlyStorageFormat_BulkDenseContentHeaderStr(
												headerPtr,
												usingChecksums,
												version);
		break;

	default:
		{
			StringInfoData buf;
			
			initStringInfo(&buf);
			appendStringInfo(
				&buf,
				"Append-Only storage header kind %d unknown",
				aoHeaderKind);

			str = buf.data;
		}
		break;
	}

	return str;
}