Example #1
0
        private Protobuf.CreateIndexCommand ConvertIndexProto(IndexConfiguration indexConfig)
        {
            Protobuf.CreateIndexCommand.Builder _createIndexCommand = new CreateIndexCommand.Builder();
            _createIndexCommand.IndexName      = indexConfig.Name;
            _createIndexCommand.CachePolicy    = indexConfig.CachePolicy;
            _createIndexCommand.JournalEnabled = indexConfig.JournalEnabled;
            Protobuf.IndexAttributeProto.Builder _indexAttribute = new Protobuf.IndexAttributeProto.Builder()
            {
                Name = indexConfig.Attributes.Name, Order = indexConfig.Attributes.Order
            };
            _createIndexCommand.Attributes = _indexAttribute.Build();

            return(_createIndexCommand.Build());
        }
        internal override void BuildInternal()
        {
            //build command
            _createIndexCommand.IndexName      = _indexConfiguration.Name;
            _createIndexCommand.CachePolicy    = _indexConfiguration.CachePolicy;
            _createIndexCommand.JournalEnabled = _indexConfiguration.JournalEnabled;


            Protobuf.IndexAttributeProto.Builder _indexAttribute = new Protobuf.IndexAttributeProto.Builder()
            {
                Name  = _indexConfiguration.Attributes.Name,
                Order = _indexConfiguration.Attributes.Order
            };
            _createIndexCommand.Attributes = (_indexAttribute.Build());


            base._command.SetCreateIndexCommand(_createIndexCommand);
            base._command.SetType(Alachisoft.NosDB.Common.Protobuf.Command.Types.Type.CREATE_INDEX);
        }