Beispiel #1
0
        public void LoadSmallCSVFilesWideFormatTest()
        {
            ApiHelper helper     = new ApiHelper(account, token, api);
            var       apiHelper  = new ApiHelper(account, token, api);
            var       dataStream = apiHelper.SetDataStream(streamName, "GMT", MODELTYPE.SLIDING_WINDOW);
            // -d '{ "jobType": "INGESTDATA", "status": "CREATED", "datastream": "1554938538981549", "spec": { "format": {"entityIdentifier": "person", "timeIdentifier": "time", "timeFormat": "YYYY-MMDD HH:mm:ss.SSS", "timeZone": "America/Los_Angeles" } } }
            var sf = new StreamFormat()
            {
                entityIdentifier = "entity",
                timeIdentifier   = "timestamp",
                timeFormat       = "YYYY-MM-DD HH:mm:ss",
                timeZone         = "Europe/London"
            };
            var spec = new IngestSpec <StreamFormat>()
            {
                format = sf
            };
            var job = new Job <StreamFormat>()
            {
                jobType    = JOBTYPE.INGESTDATA,
                status     = JOBSTATUS.CREATED,
                datastream = dataStream.id,
                spec       = spec
            };

            var response = apiHelper.LoadCSVFiles(filePaths, job, 3);

            Assert.NotNull(response);
            Assert.True(response.Count > (filePaths.Count + 2));
        }
Beispiel #2
0
        public void LoadCSVFileWideFormatChunkedTest()
        {
            ApiHelper helper    = new ApiHelper(account, token, api);
            var       files     = from file in Directory.EnumerateFiles(Path.Combine(rootPath, "WideFormat"), "*Medium5.csv", SearchOption.AllDirectories) select file;
            var       apiHelper = new ApiHelper(account, token, api);
            var       stream    = apiHelper.SetDataStream(streamName, "GMT", MODELTYPE.SLIDING_WINDOW);
            // -d '{ "jobType": "INGESTDATA", "status": "CREATED", "datastream": "1554938538981549", "spec": { "format": {"entityIdentifier": "person", "timeIdentifier": "time", "timeFormat": "YYYY-MMDD HH:mm:ss.SSS", "timeZone": "America/Los_Angeles" } } }
            var sf = new StreamFormat()
            {
                entityIdentifier = "entity",
                timeIdentifier   = "timestamp",
                timeFormat       = "YYYY-MM-DD HH:mm:ss",
                timeZone         = "Europe/London"
            };
            var spec = new IngestSpec <StreamFormat>()
            {
                format = sf
            };
            var job = new Job <StreamFormat>()
            {
                jobType    = JOBTYPE.INGESTDATA,
                status     = JOBSTATUS.CREATED,
                datastream = (string)stream.id,
                spec       = spec
            };

            foreach (var file in files)
            {
                var response = apiHelper.LoadCSVFile(file, job, 6U);
                Assert.NotNull(response);
                Assert.Equal(response[response.Count - 1].status, JOBSTATUS.COMPLETED.ToString());
            }
        }