Skip to content

Commit

Permalink
#102 Change G2 to Sz (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
docktermj authored Sep 30, 2024
1 parent 8527377 commit f125068
Show file tree
Hide file tree
Showing 2 changed files with 193 additions and 191 deletions.
143 changes: 72 additions & 71 deletions proposals/SDKs-for-V4/canonical-names-condensed.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,88 +12,89 @@ The following list should reflect modifications documented in

| Existing name | Canonical Name | Return value | Smells |
|---------------|----------------|--------------|--------|
| G2Config_addDataSource(configHandle, inputJson, responseBuf, bufSize, resizeFunc) | addDataSource(configHandle, dataSourceCode) | string | |
| G2Config_clearLastException() | [not-public] | | |
| G2Config_close(configHandle) | closeConfig(configHandle) | - | |
| G2Config_create(configHandle) | createConfig() | configHandle | |
| G2Config_deleteDataSource(configHandle, inputJson) | deleteDataSource(configHandle, dataSourceCode) | - | |
| G2Config_destroy() | | - | |
| G2Config_init(moduleName, iniParams, verboseLogging) | initialize(instanceName, settings, verboseLogging) | - | Consider single object |
| G2Config_listDataSources(configHandle, responseBuf, bufSize, resizeFunc) | getDataSources(configHandle) | string | |
| G2Config_load(jsonConfig, configHandle) | importConfig(configDefinition) | configHandle | |
| G2Config_save(configHandle, responseBuf, bufSize, resizeFunc) | exportConfig(configHandle) | string | |
| SzConfig_addDataSource(configHandle, inputJson, responseBuf, bufSize, resizeFunc) | addDataSource(configHandle, dataSourceCode) | string | |
| SzConfig_clearLastException() | [not-public] | | |
| SzConfig_close(configHandle) | closeConfig(configHandle) | - | |
| SzConfig_create(configHandle) | createConfig() | configHandle | |
| SzConfig_deleteDataSource(configHandle, inputJson) | deleteDataSource(configHandle, dataSourceCode) | - | |
| SzConfig_destroy() | | - | |
| SzConfig_init(moduleName, iniParams, verboseLogging) | initialize(instanceName, settings, verboseLogging) | - | Consider single object |
| SzConfig_listDataSources(configHandle, responseBuf, bufSize, resizeFunc) | getDataSources(configHandle) | string | |
| SzConfig_load(jsonConfig, configHandle) | importConfig(configDefinition) | configHandle | |
| SzConfig_save(configHandle, responseBuf, bufSize, resizeFunc) | exportConfig(configHandle) | string | |

### SzConfigManager

| Existing name | Canonical Name | Return value | Smells |
|---------------|----------------|--------------|--------|
| G2ConfigMgr_addConfig(configStr, configComment, configID) | addConfig(configDefinition, configComment) | int64 | |
| G2ConfigMgr_destroy() | | - | |
| G2ConfigMgr_getConfig(configID, responseBuf, bufSize, resizeFunc) | getConfig(configId) | string | |
| G2ConfigMgr_getConfigList(responseBuf, bufSize, resizeFunc) | getConfigs() | string | |
| G2ConfigMgr_getDefaultConfigID(configID) | getDefaultConfigId() | int64 | |
| G2ConfigMgr_init(moduleName, iniParams, verboseLogging) | initialize(instanceName, settings, verboseLogging) | - | Consider single object |
| G2ConfigMgr_replaceDefaultConfigID(oldConfigID, newConfigID) | replaceDefaultConfigId(currentDefaultConfigId, newDefaultConfigId) | - | |
| G2ConfigMgr_setDefaultConfigID(configID) | setDefaultConfigId(configId) | - | |
| SzConfigMgr_addConfig(configStr, configComment, configID) | addConfig(configDefinition, configComment) | int64 | |
| SzConfigMgr_destroy() | | - | |
| SzConfigMgr_getConfig(configID, responseBuf, bufSize, resizeFunc) | getConfig(configId) | string | |
| SzConfigMgr_getConfigList(responseBuf, bufSize, resizeFunc) | getConfigs() | string | |
| SzConfigMgr_getDefaultConfigID(configID) | getDefaultConfigId() | int64 | |
| SzConfigMgr_init(moduleName, iniParams, verboseLogging) | initialize(instanceName, settings, verboseLogging) | - | Consider single object |
| SzConfigMgr_replaceDefaultConfigID(oldConfigID, newConfigID) | replaceDefaultConfigId(currentDefaultConfigId, newDefaultConfigId) | - | |
| SzConfigMgr_setDefaultConfigID(configID) | setDefaultConfigId(configId) | - | |

### SzDiagnostic

| Existing name | Canonical Name | Return value | Smells |
|---------------|----------------|--------------|--------|
| G2Diagnostic_checkDBPerf(secondsToRun, responseBuf, bufSize, resizeFunc) | checkDatastorePerformance(secondsToRun) | string | |
| G2Diagnostic_destroy() | | - | |
| G2Diagnostic_getDatastoreInfo(responseBuf, bufSize, resizeFunc) | getDatastoreInfo() | string | |
| G2Diagnostic_getFeature(libFeatID, responseBuf, bufSize, resizeFunc) | getFeature(featureId) | string | ** Not approved yet |
| G2Diagnostic_init(moduleName, iniParams, verboseLogging) | initialize(instanceName, settings, configId, verboseLogging) | | `configId` can be `nil`, `None`, `null`. Consider single object |
| G2Diagnostic_purgeRepository(????) | purgeRepository(????) | | |
| G2Diagnostic_reinit(initConfigID) | reinitialize(configId) | - | |
| SzDiagnostic_checkDBPerf(secondsToRun, responseBuf, bufSize, resizeFunc) | checkDatastorePerformance(secondsToRun) | string | |
| SzDiagnostic_destroy() | | - | |
| SzDiagnostic_getDatastoreInfo(responseBuf, bufSize, resizeFunc) | getDatastoreInfo() | string | |
| SzDiagnostic_getFeature(libFeatID, responseBuf, bufSize, resizeFunc) | getFeature(featureId) | string | ** Not approved yet |
| SzDiagnostic_init(moduleName, iniParams, verboseLogging) | initialize(instanceName, settings, configId, verboseLogging) | | `configId` can be `nil`, `None`, `null`. Consider single object |
| SzDiagnostic_purgeRepository(????) | purgeRepository(????) | | |
| SzDiagnostic_reinit(initConfigID) | reinitialize(configId) | - | |

### SzEngine

| Existing name | Canonical Name | Return value | Smells |
|---------------|----------------|--------------|--------|
| G2_addRecord(dataSourceCode, recordID, jsonData) | addRecord(dataSourceCode, recordId, recordDefinition, flags) | string | |
| G2_closeExport(responseHandle) | closeExport(exportHandle) | - | |
| G2_countRedoRecords() | | int64 | |
| G2_deleteRecord(dataSourceCode, recordID) | deleteRecord(dataSourceCode, recordId, flags) | string | |
| G2_destroy() | | - | |
| G2_exportCSVEntityReport(csvColumnList, flags, responseHandle) | exportCsvEntityReport(csvColumnList, flags) | exportHandle | |
| G2_exportJSONEntityReport(flags, responseHandle) | exportJsonEntityReport(flags) | exportHandle | |
| G2_fetchNext(responseHandle, responseBuf, bufSize) | fetchNext(exportHandle) | string | |
| G2_findInterestingEntitiesByEntityID(entityID, flags, responseBuf, bufSize, resizeFunc) | findInterestingEntitiesByEntityId(entityId, flags) | string | |
| G2_findInterestingEntitiesByRecordID(dataSourceCode, recordID, flags, responseBuf, bufSize, resizeFunc) | findInterestingEntitiesByRecordId(dataSourceCode, recordId, flags) | string | |
| G2_findNetworkByEntityID(entityList, maxDegree, buildOutDegree, maxEntities, responseBuf, bufSize, resizeFunc) | findNetworkByEntityId(entityIds, maxDegrees, buildOutDegrees, buildOutMaxEntities, flags) | string | SM-3.1 |
| G2_findNetworkByRecordID(recordList, maxDegree, buildOutDegree, maxEntities, responseBuf, bufSize, resizeFunc) | findNetworkByRecordId(recordKeys, maxDegrees, buildOutDegrees, buildOutMaxEntities, flags) | string | SM-3.1 |
| G2_findPathByEntityID(entityID1, entityID2, maxDegree, responseBuf, bufSize, resizeFunc) | findPathByEntityId(startEntityId, endEntityId, maxDegrees, avoidEntityIds, requiredDataSources, flags) | string | SM-3.1 |
| G2_findPathByRecordID(dataSourceCode1, recordID1, dataSourceCode2, recordID2, maxDegree, responseBuf, bufSize, resizeFunc) | findPathByRecordId(startDataSourceCode, startRecordId, endDataSourceCode, endRecordId, maxDegrees, avoidRecordKeys, requiredDataSources, flags) | string | SM-3.1 |
| G2_getActiveConfigID(configID) | getActiveConfigId() | int64 | |
| G2_getEntityByEntityID(entityID, responseBuf, bufSize, resizeFunc) | getEntityByEntityId(entityId, flags) | string | |
| G2_getEntityByRecordID(dataSourceCode, recordID, responseBuf, bufSize, resizeFunc) | getEntityByRecordId(dataSourceCode, recordId, flags) | string | |
| G2_getRecord(dataSourceCode, recordID, responseBuf, bufSize, resizeFunc) | getRecord(dataSourceCode, recordId, flags) | string | |
| G2_getRedoRecord(responseBuf, bufSize, resizeFunc ) | getRedoRecord() | string | |
| G2_getVirtualEntityByRecordID(recordList, responseBuf, bufSize, resizeFunc) | getVirtualEntityByRecordId(recordKeys, flags) | string | |
| G2_howEntityByEntityID(entityID, responseBuf, bufSize, resizeFunc) | howEntityByEntityId(entityId, flags) | string | SM-1, SM-3.3 |
| G2_init(moduleName, iniParams, verboseLogging) | initialize(instanceName, settings, configId, verboseLogging) | - | `configId` can be `nil`, `None`, `null`. Consider single object |
| G2_primeEngine() | | - | |
| G2_processRedoRecord(responseBuf, bufSize, resizeFunc ) | processRedoRecord(redoRecord, flags) | string | |
| G2_reevaluateEntity(entityID, flags) | reevaluateEntity(entityId, flags) | string | `flags` has `WITH_INFO` bit |
| G2_reevaluateRecord(dataSourceCode, recordID, flags) | reevaluateRecord(dataSourceCode, recordId, flags) | string | `flags` has `WITH_INFO` bit |
| G2_reinit(initConfigID) | reinitialize(configId) | - | ??? |
| G2_searchByAttributes(jsonData, responseBuf, bufSize, resizeFunc) | searchByAttributes(attributes, searchProfile, flags) | string | |
| G2_stats(responseBuf, bufSize, resizeFunc ) | getStats() | string | |
| G2_whyEntities(entityID1, entityID2, responseBuf, bufSize, resizeFunc) | whyEntities(entityId1, entityId2, flags) | string | SM-1, SM-3.3 |
| G2_whyRecordInEntity(dataSourceCode, recordID, responseBuf, bufSize, resizeFunc) | whyRecordInEntity(dataSourceCode, recordId, flags) | string | SM-1, SM-3.3 |
| G2_whyRecords(dataSourceCode1, recordID1, dataSourceCode2, recordID2, responseBuf, bufSize, resizeFunc) | whyRecords(dataSourceCode1, recordId1, dataSourceCode2, recordId2, flags) | string | SM-1, SM-3.3 |
| Sz_addRecord(dataSourceCode, recordID, jsonData) | addRecord(dataSourceCode, recordId, recordDefinition, flags) | string | |
| Sz_closeExport(responseHandle) | closeExport(exportHandle) | - | |
| Sz_countRedoRecords() | | int64 | |
| Sz_deleteRecord(dataSourceCode, recordID) | deleteRecord(dataSourceCode, recordId, flags) | string | |
| Sz_destroy() | | - | |
| Sz_exportCSVEntityReport(csvColumnList, flags, responseHandle) | exportCsvEntityReport(csvColumnList, flags) | exportHandle | |
| Sz_exportJSONEntityReport(flags, responseHandle) | exportJsonEntityReport(flags) | exportHandle | |
| Sz_fetchNext(responseHandle, responseBuf, bufSize) | fetchNext(exportHandle) | string | |
| Sz_findInterestingEntitiesByEntityID(entityID, flags, responseBuf, bufSize, resizeFunc) | findInterestingEntitiesByEntityId(entityId, flags) | string | |
| Sz_findInterestingEntitiesByRecordID(dataSourceCode, recordID, flags, responseBuf, bufSize, resizeFunc) | findInterestingEntitiesByRecordId(dataSourceCode, recordId, flags) | string | |
| Sz_findNetworkByEntityID(entityList, maxDegree, buildOutDegree, maxEntities, responseBuf, bufSize, resizeFunc) | findNetworkByEntityId(entityIds, maxDegrees, buildOutDegrees, buildOutMaxEntities, flags) | string | SM-3.1 |
| Sz_findNetworkByRecordID(recordList, maxDegree, buildOutDegree, maxEntities, responseBuf, bufSize, resizeFunc) | findNetworkByRecordId(recordKeys, maxDegrees, buildOutDegrees, buildOutMaxEntities, flags) | string | SM-3.1 |
| Sz_findPathByEntityID(entityID1, entityID2, maxDegree, responseBuf, bufSize, resizeFunc) | findPathByEntityId(startEntityId, endEntityId, maxDegrees, avoidEntityIds, requiredDataSources, flags) | string | SM-3.1 |
| Sz_findPathByRecordID(dataSourceCode1, recordID1, dataSourceCode2, recordID2, maxDegree, responseBuf, bufSize, resizeFunc) | findPathByRecordId(startDataSourceCode, startRecordId, endDataSourceCode, endRecordId, maxDegrees, avoidRecordKeys, requiredDataSources, flags) | string | SM-3.1 |
| Sz_getActiveConfigID(configID) | getActiveConfigId() | int64 | |
| Sz_getEntityByEntityID(entityID, responseBuf, bufSize, resizeFunc) | getEntityByEntityId(entityId, flags) | string | |
| Sz_getEntityByRecordID(dataSourceCode, recordID, responseBuf, bufSize, resizeFunc) | getEntityByRecordId(dataSourceCode, recordId, flags) | string | |
| Sz_getRecord(dataSourceCode, recordID, responseBuf, bufSize, resizeFunc) | getRecord(dataSourceCode, recordId, flags) | string | |
| Sz_getRedoRecord(responseBuf, bufSize, resizeFunc ) | getRedoRecord() | string | |
| Sz_getVirtualEntityByRecordID(recordList, responseBuf, bufSize, resizeFunc) | getVirtualEntityByRecordId(recordKeys, flags) | string | |
| Sz_howEntityByEntityID(entityID, responseBuf, bufSize, resizeFunc) | howEntityByEntityId(entityId, flags) | string | SM-1, SM-3.3 |
| Sz_init(moduleName, iniParams, verboseLogging) | initialize(instanceName, settings, configId, verboseLogging) | - | `configId` can be `nil`, `None`, `null`. Consider single object |
| Sz_preprocessRecord(jsonData, flags, responseBuf, bufSize, resizeFunc ) | preprocessRecord(record, flags) | string | |
| Sz_primeEngine() | | - | |
| Sz_processRedoRecord(responseBuf, bufSize, resizeFunc ) | processRedoRecord(redoRecord, flags) | string | |
| Sz_reevaluateEntity(entityID, flags) | reevaluateEntity(entityId, flags) | string | `flags` has `WITH_INFO` bit |
| Sz_reevaluateRecord(dataSourceCode, recordID, flags) | reevaluateRecord(dataSourceCode, recordId, flags) | string | `flags` has `WITH_INFO` bit |
| Sz_reinit(initConfigID) | reinitialize(configId) | - | ??? |
| Sz_searchByAttributes(jsonData, responseBuf, bufSize, resizeFunc) | searchByAttributes(attributes, searchProfile, flags) | string | |
| Sz_stats(responseBuf, bufSize, resizeFunc ) | getStats() | string | |
| Sz_whyEntities(entityID1, entityID2, responseBuf, bufSize, resizeFunc) | whyEntities(entityId1, entityId2, flags) | string | SM-1, SM-3.3 |
| Sz_whyRecordInEntity(dataSourceCode, recordID, responseBuf, bufSize, resizeFunc) | whyRecordInEntity(dataSourceCode, recordId, flags) | string | SM-1, SM-3.3 |
| Sz_whyRecords(dataSourceCode1, recordID1, dataSourceCode2, recordID2, responseBuf, bufSize, resizeFunc) | whyRecords(dataSourceCode1, recordId1, dataSourceCode2, recordId2, flags) | string | SM-1, SM-3.3 |

### SzProduct

| Existing name | Canonical Name | Return value | Smells |
|---------------|----------------|--------------|--------|
| G2Product_destroy() | | - | |
| G2Product_init(moduleName, iniParams, verboseLogging) | initialize(instanceName, settings, verboseLogging) | - | |
| G2Product_license() | getLicense() | string | |
| G2Product_validateLicenseStringBase64(licenseString, errorBuf, errorBufSize, resizeFunc) | ??? | | |
| G2Product_version() | getVersion() | string | |
| SzProduct_destroy() | | - | |
| SzProduct_init(moduleName, iniParams, verboseLogging) | initialize(instanceName, settings, verboseLogging) | - | |
| SzProduct_license() | getLicense() | string | |
| SzProduct_validateLicenseStringBase64(licenseString, errorBuf, errorBufSize, resizeFunc) | ??? | | |
| SzProduct_version() | getVersion() | string | |

## Abstract Factory

Expand All @@ -112,14 +113,14 @@ The following list should reflect modifications documented in
### Handling WithInfo - Proposal 1

1. Functions affected:
- G2_addRecordWithInfo
- G2_deleteRecordWithInfo
- G2_processWithInfo
- G2_reevaluateEntityWithInfo
- G2_reevaluateRecordWithInfo
- G2_replaceRecordWithInfo
- Sz_addRecordWithInfo
- Sz_deleteRecordWithInfo
- Sz_processWithInfo
- Sz_reevaluateEntityWithInfo
- Sz_reevaluateRecordWithInfo
- Sz_replaceRecordWithInfo
1. Approach:
1. Function name becomes shortened to match the non-with-info name (e.g. `G2_addRecord()`).
1. Function name becomes shortened to match the non-with-info name (e.g. `Sz_addRecord()`).
1. The `xx_withInfo()` function/method signature is not in the SDK.
1. Function always returns JSON string.
1. A final input parameter, say `resultFlags` (int64 used as a bit-mask), indicates the nature of the content returned in the JSON string.
Expand All @@ -130,8 +131,8 @@ The following list should reflect modifications documented in
```

1. If `resultFlags` is 0 (i.e. no bit flags are on) then the returned value is `{}`, an empty JSON string.
1. Beneath the covers, the SDK determines if the `WITH_INFO` bit is **off**, in which case it calls `G2_addRecord`.
If the `WITH_INFO` bit is **on**, the SDK calls `G2_addRecordWithInfo`.
1. Beneath the covers, the SDK determines if the `WITH_INFO` bit is **off**, in which case it calls `Sz_addRecord`.
If the `WITH_INFO` bit is **on**, the SDK calls `Sz_addRecordWithInfo`.
1. Flag can be OR-ed for future expansion. Example:

```python
Expand Down
Loading

0 comments on commit f125068

Please sign in to comment.