def createCF():
    # Create column families for Events
    try:
        yield db.system_drop_column_family("userAgenda")
    except: pass
    userAgenda = ttypes.CfDef(KEYSPACE, "userAgenda", "Standard", "TimeUUIDType",
                              None, "Time sorted list of events for a user")
    yield db.system_add_column_family(userAgenda)

    try:
        yield db.system_drop_column_family("userAgendaMap")
    except: pass
    userAgendaMap = ttypes.CfDef(KEYSPACE, "userAgendaMap", "Standard", "TimeUUIDType",
                                 None, "Reverse map of user:event to agenda entry")
    yield db.system_add_column_family(userAgendaMap)

    try:
        yield db.system_drop_column_family("eventResponses")
    except: pass
    eventResponses = ttypes.CfDef(KEYSPACE, "eventResponses", "Standard", "UTF8Type",
                                  None, "List of RSVP responses to an event")
    yield db.system_add_column_family(eventResponses)
예제 #2
0
def createCF():
    # Create column families required for file listing
    #    drop user_files CF
    #    create user_files entityFeed_files
    #
    yield db.system_drop_column_family('user_files')
    user_files = ttypes.CfDef(KEYSPACE, 'user_files', 'Standard',
                             'TimeUUIDType', None,
                             "List of files owned by the user")
    yield db.system_add_column_family(user_files)

    entityFeed_files = ttypes.CfDef(KEYSPACE, 'entityFeed_files',
                                'Standard', 'TimeUUIDType', None,
                                "List of files that appeared in entity's feed")
    yield db.system_add_column_family(entityFeed_files)

    #Remove User from network
    userSessionsMap = ttypes.CfDef(KEYSPACE, 'userSessionsMap', 'Standard',
                            'BytesType', None, 'userId-Session Map')
    yield db.system_add_column_family(userSessionsMap)

    deletedUsers = ttypes.CfDef(KEYSPACE, "deletedUsers", "Standard", "UTF8Type", None,
                         "List of users removed from the networks by admins.")
    yield db.system_add_column_family(deletedUsers)

    #Preset Tags

    orgPresetTags = ttypes.CfDef(KEYSPACE, "orgPresetTags", "Standard", "UTF8Type",
                          None, "List of preset tags. Only admin can create"
                          "or delete these tags. unlike normal tags these tags"
                          "will not be deleted automatically. On deletion it"
                          "behaves like a normal tag")
    yield db.system_add_column_family(orgPresetTags)

    #Keyword Monitoring
    keywords = ttypes.CfDef(KEYSPACE, 'keywords', 'Standard', 'UTF8Type',
                            None, "list of keywords to be monitored")
    yield db.system_add_column_family(keywords)

    originalKeywords = ttypes.CfDef(KEYSPACE, 'originalKeywords', 'Standard', 'UTF8Type',
                                    None, 'list of original keywords')
    yield db.system_add_column_family(originalKeywords)

    keywordItems = ttypes.CfDef(KEYSPACE, "keywordItems", "Standard", "TimeUUIDType",
                                None, "list of items which have a keyword monitored by admins")
    yield db.system_add_column_family(keywordItems)

    #API
    apps = ttypes.CfDef(KEYSPACE, "apps", "Super", "UTF8Type", "UTF8Type",
                 "Details of Applications registered for API Access")
    yield db.system_add_column_family(apps)

    appsByOwner = ttypes.CfDef(KEYSPACE, "appsByOwner", "Standard", "UTF8Type",
                        None, "List of applications registered by a User")
    yield db.system_add_column_family(appsByOwner)

    oAuthData = ttypes.CfDef(KEYSPACE, "oAuthData", "Standard", "UTF8Type",
                      None, "List of access, refresh tokens and auth codes")
    yield db.system_add_column_family(oAuthData)

    #
    # Create column families for poll indexing (in feeds and userItems)
    #
    userItemsType = ttypes.CfDef(KEYSPACE, 'userItems_poll', 'Standard',
                          'TimeUUIDType', None,
                          'poll items posted by a given user')
    yield db.system_add_column_family(userItemsType)

    feedType = ttypes.CfDef(KEYSPACE, 'feed_poll', 'Standard', 'TimeUUIDType',
                     None, 'Feed of poll items')
    yield db.system_add_column_family(feedType)

    #
    # Remove unused feed and userItems index
    #
    try:
        yield db.system_drop_column_family('feed_document')
    except: pass
    try:
        yield db.system_drop_column_family('userItems_document')
    except: pass
예제 #3
0
def createCF():
    attachmentVersions = ttypes.CfDef(KEYSPACE, "attachmentVersions", "Standard", "TimeUUIDType",
                                      None, "Time sorted list of versions of each attachment")
    yield db.system_add_column_family(attachmentVersions)