Esempio n. 1
0
        public async Task DoUserOperations(UserOperations operations)
        {
            CellSet cellSet =
                HbaseRowFactory.CreateFactory("dewey_users", operations.Key)
                .AddColumnStringValue("description", "login", operations.Login)
                .AddColumnStringValue("description", "password", operations.Password)
                .AddColumnStringValue("description", "name", operations.Name)
                .AddColumnStringValue("description", "surname", operations.SurName)
                .AddColumnBooleanValue("params", "is_add", operations.IsAdd)
                .AddColumnBooleanValue("params", "is_change", operations.IsChange)
                .AddColumnBooleanValue("params", "is_delete", operations.IsDelete)
                .AddColumnDateTimeValue("history", "operation_date", operations.OperationDate)
                .AddColumnLongValue("history", "orderby", operations.OrderBy)
                .MakeCellSet();

            //StargateApi.WriteValue(operations.Name,"dewey_users",operations.Key, "description","name");

            await StargateApi.WriteCellsAsync(cellSet);
        }
Esempio n. 2
0
        public async Task DoFileOperations(FileOperations operations)
        {
            HbaseRowFactory factory =
                HbaseRowFactory.CreateFactory("dewey_files", operations.Key)
                .AddColumnStringValue("description", "filename", operations.FileName)
                .AddColumnStringValue("description", "extension", operations.Extension)
                .AddColumnBooleanValue("params", "is_add", operations.IsAdd)
                .AddColumnBooleanValue("params", "is_change", operations.IsChange)
                .AddColumnBooleanValue("params", "is_delete", operations.IsDelete)
                .AddColumnBooleanValue("params", "is_clone", operations.IsClone)
                .AddColumnDateTimeValue("history", "operation_date", operations.OperationDate)
                .AddColumnLongValue("history", "orderby", operations.OrderBy);

            if (!string.IsNullOrEmpty(operations.Parent))
            {
                factory = factory.AddColumnStringValue("params", "parent", operations.Parent);
            }

            CellSet cellSet = factory.MakeCellSet();

            await StargateApi.WriteCellsAsync(cellSet);

            //return true;
        }