/// <inheritdoc/>
        public void WriteJson(JsonWriter writer)
        {
            if (!string.IsNullOrWhiteSpace(name))
            {
                System.Diagnostics.Debug.Assert(string.IsNullOrWhiteSpace(bucket), "Bucket should be empty if Name specified");
                System.Diagnostics.Debug.Assert(string.IsNullOrWhiteSpace(key), "Key should be empty if Name specified");
                System.Diagnostics.Debug.Assert(string.IsNullOrWhiteSpace(source), "Source should be empty if Name specified");
            }
            else if (!string.IsNullOrWhiteSpace(source))
            {
                System.Diagnostics.Debug.Assert(string.IsNullOrWhiteSpace(bucket), "Bucket should be empty if Name specified");
                System.Diagnostics.Debug.Assert(string.IsNullOrWhiteSpace(key), "Key should be empty if Name specified");
                System.Diagnostics.Debug.Assert(string.IsNullOrWhiteSpace(name), "Name should be empty if Name specified");
            }
            else
            {
                System.Diagnostics.Debug.Assert(!string.IsNullOrWhiteSpace(bucket), "Bucket should not be empty");
                System.Diagnostics.Debug.Assert(!string.IsNullOrWhiteSpace(key), "Key should not be empty");
            }

            writer.WriteSpecifiedProperty("language", RiakConstants.MapReduceLanguage.JavaScript)
                .WriteSpecifiedProperty("source", source)
                .WriteSpecifiedProperty("name", name)
                .WriteSpecifiedProperty("bucket", bucket)
                .WriteSpecifiedProperty("key", key);
        }
コード例 #2
0
        public void WriteJson(JsonWriter writer)
        {
            System.Diagnostics.Debug.Assert(!string.IsNullOrWhiteSpace(_module), "Module must be set");
            System.Diagnostics.Debug.Assert(!string.IsNullOrWhiteSpace(_function), "Function must be set");

            writer.WriteSpecifiedProperty("language", RiakConstants.MapReduceLanguage.Erlang)
                .WriteSpecifiedProperty("module", _module)
                .WriteSpecifiedProperty("function", _function);
        }
コード例 #3
0
 protected override void WriteJson(JsonWriter writer)
 {
     writer.WriteSpecifiedProperty("bucket", bucket)
         .WriteSpecifiedProperty("tag", tag);
 }