Example #1
0
		public static void ExecuteAction(ExecuteResultSet rlt, WcfAction action)
		{
			ActionExecutor exe = GetExecutor(action);
			if (exe != null)
			{
				rlt.Add(exe.Execute(action));
			}
		}
Example #2
0
		public static ExecuteResultSet ExecuteActions(Collection<WcfAction> actions)
		{
			ExecuteResultSet rlt = new ExecuteResultSet();
			if (actions != null)
			{
				foreach (WcfAction action in actions)
				{
					ExecuteAction(rlt, action);
				}
			}
			return rlt;
		}
        private async Task FetchJobNextResultAsync()
        {
            var fetchResponse = await Connection.SqlSession.FetchResultAsync(_jobId, ++_token);

            if (fetchResponse is null)
            {
                throw new FlinkSqlException("fetch result failed");
            }

            _nextResultUri = fetchResponse.NextResultUri;

            _currentResultSet = fetchResponse.Results is null ? null : fetchResponse.Results[0];
            _currentReadIndex = -1;
        }
        private FlinkSqlDataReader(FlinkSqlCommand sqlCommand, CommandBehavior behavior, string jobId, ExecuteResultSet resultSet)
        {
            Command  = sqlCommand ?? throw new ArgumentNullException(nameof(sqlCommand));
            Behavior = behavior;

            _jobId            = jobId;
            _currentResultSet = resultSet;

            // with jobId fetch the first result to get column infos
            if (!string.IsNullOrWhiteSpace(jobId))
            {
                Func <Task> fetchJobFirstResultFunc = () => FetchJobNextResultAsync();

                fetchJobFirstResultFunc.RunSync();
            }
        }