BlueSpice MediaWiki REL1_27
 All Classes Namespaces Files Functions Variables Groups Pages
SMWDIHandlerBlob Class Reference
Inheritance diagram for SMWDIHandlerBlob:
Collaboration diagram for SMWDIHandlerBlob:

Public Member Functions

 getTableFields ()
 
 getFetchFields ()
 
 getTableIndexes ()
 
 getWhereConds (SMWDataItem $dataItem)
 
 getInsertValues (SMWDataItem $dataItem)
 
 getIndexField ()
 
 getLabelField ()
 
 dataItemFromDBKeys ($dbkeys)
 
- Public Member Functions inherited from SMWDataItemHandler
 __construct (SMWSQLStore3 $store)
 
 getTableFields ()
 
 getFetchFields ()
 
 getTableIndexes ()
 
 getWhereConds (SMWDataItem $dataItem)
 
 getInsertValues (SMWDataItem $dataItem)
 
 getIndexField ()
 
 getLabelField ()
 
 dataItemFromDBKeys ($dbkeys)
 

Public Attributes

const MAX_HASH_LENGTH = 72
 

Static Protected Member Functions

static makeHash ($string)
 

Additional Inherited Members

- Protected Attributes inherited from SMWDataItemHandler
 $store
 

Detailed Description

This class implements Store access to blob (string) data items.

Since
1.8
Author
Nischay Nahata

Member Function Documentation

SMWDIHandlerBlob::dataItemFromDBKeys (   $dbkeys)
See Also
SMWDataItemHandler::dataItemFromDBKeys()
Since
1.8
Parameters
array | string$dbkeysexpecting array here
Returns
SMWDataItem
SMWDIHandlerBlob::getFetchFields ( )
See Also
SMWDataItemHandler::getFetchFields()
Since
1.8
Returns
array
SMWDIHandlerBlob::getIndexField ( )

Method to return the field used to select this type of DataItem

Since
1.8
Returns
string
SMWDIHandlerBlob::getInsertValues ( SMWDataItem  $dataItem)

Method to return an array of fields=>values for a DataItem This array is used to perform all insert operations into the DB To optimize return minimum fields having indexes

Returns
array
SMWDIHandlerBlob::getLabelField ( )

Method to return the field used to select this type of DataItem using the label

Since
1.8
Returns
string
SMWDIHandlerBlob::getTableFields ( )

Method to return array of fields for a DI type

Returns
array
SMWDIHandlerBlob::getTableIndexes ( )
See Also
SMWDataItemHandler::getTableIndexes
Since
2.4
Returns
array
SMWDIHandlerBlob::getWhereConds ( SMWDataItem  $dataItem)

Method to return an array of fields=>values for a DataItem

Returns
array
static SMWDIHandlerBlob::makeHash (   $string)
staticprotected

Method to make a hashed representation for strings of length greater than self::MAX_HASH_LENGTH to be used for selecting and sorting.

Since
1.8
Parameters
$stringstring
Returns
string

Member Data Documentation

const SMWDIHandlerBlob::MAX_HASH_LENGTH = 72

Maximal number of bytes (chars) to be stored in the hash field of the table. Must not be bigger than 255 (the length of our VARCHAR field in the DB). Strings that are longer than this will be stored as a blob, and the hash will only start with the original string but the last 32 bytes are used for a hash. So the minimal portion of the string that is stored literally in the hash is 32 chars less.

The value of 72 was chosen since it leads to a smaller index size at the cost of needing more blobs in cases where many strings are of length 73 to 255. But keeping the index small seems more important than saving disk space. Also, with 72 bytes there are at least 40 bytes of content available for sorting and prefix matching, which should be more than enough in most contexts.

Since
1.8

The documentation for this class was generated from the following file: