internal HdfsReadSettings(string type, object maxConcurrentConnections, IDictionary <string, object> additionalProperties, object recursive, object wildcardFolderPath, object wildcardFileName, bool?enablePartitionDiscovery, object modifiedDatetimeStart, object modifiedDatetimeEnd, DistcpSettings distcpSettings) : base(type, maxConcurrentConnections, additionalProperties)
 {
     Recursive                = recursive;
     WildcardFolderPath       = wildcardFolderPath;
     WildcardFileName         = wildcardFileName;
     EnablePartitionDiscovery = enablePartitionDiscovery;
     ModifiedDatetimeStart    = modifiedDatetimeStart;
     ModifiedDatetimeEnd      = modifiedDatetimeEnd;
     DistcpSettings           = distcpSettings;
     Type = type ?? "HdfsReadSettings";
 }
Example #2
0
        internal static HdfsSource DeserializeHdfsSource(JsonElement element)
        {
            Optional <object>         recursive                         = default;
            Optional <DistcpSettings> distcpSettings                    = default;
            string                       type                           = default;
            Optional <object>            sourceRetryCount               = default;
            Optional <object>            sourceRetryWait                = default;
            Optional <object>            maxConcurrentConnections       = default;
            IDictionary <string, object> additionalProperties           = default;
            Dictionary <string, object>  additionalPropertiesDictionary = new Dictionary <string, object>();

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("recursive"))
                {
                    recursive = property.Value.GetObject();
                    continue;
                }
                if (property.NameEquals("distcpSettings"))
                {
                    distcpSettings = DistcpSettings.DeserializeDistcpSettings(property.Value);
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("sourceRetryCount"))
                {
                    sourceRetryCount = property.Value.GetObject();
                    continue;
                }
                if (property.NameEquals("sourceRetryWait"))
                {
                    sourceRetryWait = property.Value.GetObject();
                    continue;
                }
                if (property.NameEquals("maxConcurrentConnections"))
                {
                    maxConcurrentConnections = property.Value.GetObject();
                    continue;
                }
                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
            }
            additionalProperties = additionalPropertiesDictionary;
            return(new HdfsSource(type, sourceRetryCount.Value, sourceRetryWait.Value, maxConcurrentConnections.Value, additionalProperties, recursive.Value, distcpSettings.Value));
        }
Example #3
0
        internal static HdfsReadSettings DeserializeHdfsReadSettings(JsonElement element)
        {
            Optional <object>         recursive                = default;
            Optional <object>         wildcardFolderPath       = default;
            Optional <object>         wildcardFileName         = default;
            Optional <bool>           enablePartitionDiscovery = default;
            Optional <object>         modifiedDatetimeStart    = default;
            Optional <object>         modifiedDatetimeEnd      = default;
            Optional <DistcpSettings> distcpSettings           = default;
            string                       type = default;
            Optional <object>            maxConcurrentConnections       = default;
            IDictionary <string, object> additionalProperties           = default;
            Dictionary <string, object>  additionalPropertiesDictionary = new Dictionary <string, object>();

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("recursive"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    recursive = property.Value.GetObject();
                    continue;
                }
                if (property.NameEquals("wildcardFolderPath"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    wildcardFolderPath = property.Value.GetObject();
                    continue;
                }
                if (property.NameEquals("wildcardFileName"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    wildcardFileName = property.Value.GetObject();
                    continue;
                }
                if (property.NameEquals("enablePartitionDiscovery"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    enablePartitionDiscovery = property.Value.GetBoolean();
                    continue;
                }
                if (property.NameEquals("modifiedDatetimeStart"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    modifiedDatetimeStart = property.Value.GetObject();
                    continue;
                }
                if (property.NameEquals("modifiedDatetimeEnd"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    modifiedDatetimeEnd = property.Value.GetObject();
                    continue;
                }
                if (property.NameEquals("distcpSettings"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    distcpSettings = DistcpSettings.DeserializeDistcpSettings(property.Value);
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("maxConcurrentConnections"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    maxConcurrentConnections = property.Value.GetObject();
                    continue;
                }
                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
            }
            additionalProperties = additionalPropertiesDictionary;
            return(new HdfsReadSettings(type, maxConcurrentConnections.Value, additionalProperties, recursive.Value, wildcardFolderPath.Value, wildcardFileName.Value, Optional.ToNullable(enablePartitionDiscovery), modifiedDatetimeStart.Value, modifiedDatetimeEnd.Value, distcpSettings.Value));
        }
Example #4
0
 internal HdfsSource(string type, object sourceRetryCount, object sourceRetryWait, object maxConcurrentConnections, IDictionary <string, object> additionalProperties, object recursive, DistcpSettings distcpSettings) : base(type, sourceRetryCount, sourceRetryWait, maxConcurrentConnections, additionalProperties)
 {
     Recursive      = recursive;
     DistcpSettings = distcpSettings;
     Type           = type ?? "HdfsSource";
 }