示例#1
0
        /// <summary>
        /// Updates the keyspace and token information
        /// </summary>
        public async Task <bool> RefreshSchemaAsync(string keyspace = null, string table = null)
        {
            if (keyspace == null)
            {
                await ControlConnection.ScheduleAllKeyspacesRefreshAsync(true).ConfigureAwait(false);

                return(true);
            }

            await ControlConnection.ScheduleKeyspaceRefreshAsync(keyspace, true).ConfigureAwait(false);

            _keyspaces.TryGetValue(keyspace, out var ks);
            if (ks == null)
            {
                return(false);
            }

            if (table != null)
            {
                ks.ClearTableMetadata(table);
            }
            return(true);
        }