update thrift, opencensus, others (#893)

* update thrift, opencensus, others

* stats: update to opencensus 0.6.0 view api
This commit is contained in:
Reed Allman
2018-03-26 15:43:49 -07:00
committed by GitHub
parent 0ce5c4500b
commit 8af605cf3d
1266 changed files with 122191 additions and 28775 deletions

View File

@@ -78,6 +78,10 @@ if WITH_RS
SUBDIRS += rs
endif
if WITH_CL
SUBDIRS += cl
endif
#
# generate html for ThriftTest.thrift
#

47
vendor/git.apache.org/thrift.git/tutorial/cl/Makefile.am generated vendored Executable file
View File

@@ -0,0 +1,47 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
gen-cl: $(top_srcdir)/tutorial/tutorial.thrift
$(THRIFT) --gen cl -r $<
TutorialServer: make-tutorial-server.lisp
$(SBCL) --script make-tutorial-server.lisp
TutorialClient: make-tutorial-client.lisp
$(SBCL) --script make-tutorial-client.lisp
all-local: gen-cl TutorialClient TutorialServer
tutorialserver: all
./TutorialServer
tutorialclient: all
./TutorialClient
clean-local:
$(RM) -r gen-*
$(RM) TutorialServer
$(RM) TutorialClient
EXTRA_DIST = \
tutorial-implementation.lisp \
shared-implementation.lisp \
thrift-tutorial.asd \
make-tutorial-server.lisp \
make-tutorial-client.lisp

View File

@@ -0,0 +1,51 @@
(in-package #:cl-user)
;;;; Licensed under the Apache License, Version 2.0 (the "License");
;;;; you may not use this file except in compliance with the License.
;;;; You may obtain a copy of the License at
;;;;
;;;; http://www.apache.org/licenses/LICENSE-2.0
;;;;
;;;; Unless required by applicable law or agreed to in writing, software
;;;; distributed under the License is distributed on an "AS IS" BASIS,
;;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
;;;; See the License for the specific language governing permissions and
;;;; limitations under the License.
(require "asdf")
(load (merge-pathnames "../../lib/cl/load-locally.lisp" *load-truename*))
(asdf:load-system :net.didierverna.clon)
(asdf:load-asd (merge-pathnames "gen-cl/shared/thrift-gen-shared.asd" *load-truename*))
(asdf:load-asd (merge-pathnames "gen-cl/tutorial/thrift-gen-tutorial.asd" *load-truename*))
(asdf:load-asd (merge-pathnames "thrift-tutorial.asd" *load-truename*))
(asdf:load-system :thrift-tutorial)
(net.didierverna.clon:nickname-package)
(defun main ()
"Entry point for the binary."
(thrift:with-client (prot #u"thrift://127.0.0.1:9090")
(tutorial.calculator:ping prot)
(format t "ping()~%")
(format t "1 + 1 = ~a~%" (tutorial.calculator:add prot 1 1))
(let ((work-instance (tutorial:make-work :num1 5
:num2 0
:op tutorial:operation.divide
:comment "Booya!")))
(handler-case (format t
"5 / 0 = ~a - Oh, really? An exception should have been thrown here.~%"
(tutorial.calculator:calculate prot 1 work-instance))
(tutorial:invalidoperation (e)
(format t "---~%(Expected) Invalid Operation caught: ~%~a~%---~%" e))))
(let ((work-instance (tutorial:make-work :num1 15
:num2 10
:op tutorial:operation.subtract
:comment "Playing nice this time.")))
(handler-case (format t
"15 - 10 = ~a~%"
(tutorial.calculator:calculate prot 1 work-instance))
(tutorial:invalidoperation (e)
(format t "---~%(Unexpected) Invalid Operation caught: ~%~a~%---~%" e))))
(format t "Check log: ~a~%" (shared.shared-service:get-struct prot 1))))
(clon:dump "TutorialClient" main)

View File

@@ -0,0 +1,29 @@
(in-package #:cl-user)
;;;; Licensed under the Apache License, Version 2.0 (the "License");
;;;; you may not use this file except in compliance with the License.
;;;; You may obtain a copy of the License at
;;;;
;;;; http://www.apache.org/licenses/LICENSE-2.0
;;;;
;;;; Unless required by applicable law or agreed to in writing, software
;;;; distributed under the License is distributed on an "AS IS" BASIS,
;;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
;;;; See the License for the specific language governing permissions and
;;;; limitations under the License.
(require "asdf")
(load (merge-pathnames "../../lib/cl/load-locally.lisp" *load-truename*))
(asdf:load-system :net.didierverna.clon)
(asdf:load-asd (merge-pathnames "gen-cl/shared/thrift-gen-shared.asd" *load-truename*))
(asdf:load-asd (merge-pathnames "gen-cl/tutorial/thrift-gen-tutorial.asd" *load-truename*))
(asdf:load-asd (merge-pathnames "thrift-tutorial.asd" *load-truename*))
(asdf:load-system :thrift-tutorial)
(net.didierverna.clon:nickname-package)
(defun main ()
"Entry point for the binary."
(thrift:serve #u"thrift://127.0.0.1:9090" tutorial:calculator))
(clon:dump "TutorialServer" main)

View File

@@ -0,0 +1,25 @@
(in-package #:shared-implementation)
;;;; Licensed under the Apache License, Version 2.0 (the "License");
;;;; you may not use this file except in compliance with the License.
;;;; You may obtain a copy of the License at
;;;;
;;;; http://www.apache.org/licenses/LICENSE-2.0
;;;;
;;;; Unless required by applicable law or agreed to in writing, software
;;;; distributed under the License is distributed on an "AS IS" BASIS,
;;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
;;;; See the License for the specific language governing permissions and
;;;; limitations under the License.
(defvar *structs* (make-hash-table))
(defun shared.shared-service-implementation:get-struct (key)
(format t "getStruct(~a)~%" key)
(gethash key *structs*))
(defun add-log (key value)
(setf (gethash key *structs*)
(make-instance 'shared:sharedstruct
:key key
:value (write-to-string value))))

View File

@@ -0,0 +1,17 @@
;;;; Licensed under the Apache License, Version 2.0 (the "License");
;;;; you may not use this file except in compliance with the License.
;;;; You may obtain a copy of the License at
;;;;
;;;; http://www.apache.org/licenses/LICENSE-2.0
;;;;
;;;; Unless required by applicable law or agreed to in writing, software
;;;; distributed under the License is distributed on an "AS IS" BASIS,
;;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
;;;; See the License for the specific language governing permissions and
;;;; limitations under the License.
(asdf:defsystem #:thrift-tutorial
:depends-on (#:thrift-gen-tutorial)
:serial t
:components ((:file "shared-implementation")
(:file "tutorial-implementation")))

View File

@@ -0,0 +1,41 @@
(in-package #:tutorial-implementation)
;;;; Licensed under the Apache License, Version 2.0 (the "License");
;;;; you may not use this file except in compliance with the License.
;;;; You may obtain a copy of the License at
;;;;
;;;; http://www.apache.org/licenses/LICENSE-2.0
;;;;
;;;; Unless required by applicable law or agreed to in writing, software
;;;; distributed under the License is distributed on an "AS IS" BASIS,
;;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
;;;; See the License for the specific language governing permissions and
;;;; limitations under the License.
(defun tutorial.calculator-implementation:ping ()
(format t "ping()~%"))
(defun tutorial.calculator-implementation:add (num1 num2)
(format t "add(~a, ~a)~%" num1 num2)
(+ num1 num2))
(defun tutorial.calculator-implementation:calculate (logid work)
(format t "calculate(~a, ~a)~%" logid work)
(handler-case
(let* ((num1 (tutorial:work-num1 work))
(num2 (tutorial:work-num2 work))
(op (tutorial:work-op work))
(result
(cond
((= op tutorial:operation.add) (+ num1 num2))
((= op tutorial:operation.subtract) (- num1 num2))
((= op tutorial:operation.multiply) (* num1 num2))
((= op tutorial:operation.divide) (/ num1 num2)))))
(shared-implementation::add-log logid result)
result)
(division-by-zero () (error 'tutorial:invalidoperation
:why "Division by zero."
:what-op (tutorial:work-op work)))))
(defun tutorial.calculator-implementation:zip ()
(format t "zip()~%"))

View File

@@ -51,5 +51,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.11.0.0")]
[assembly: AssemblyFileVersion("0.11.0.0")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -51,5 +51,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.11.0.0")]
[assembly: AssemblyFileVersion("0.11.0.0")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -16,7 +16,7 @@
# under the License.
name: tutorial_client
version: 0.11.0
version: 1.0.0-dev
description: A Dart client implementation of the Apache Thrift tutorial
author: Apache Thrift Developers <dev@thrift.apache.org>
homepage: http://thrift.apache.org
@@ -25,7 +25,7 @@ environment:
sdk: ">=1.13.0 <2.0.0"
dependencies:
browser: ^0.11.0
browser: ^0.10.0
shared:
path: ../gen-dart/shared
thrift:

View File

@@ -16,7 +16,7 @@
# under the License.
name: tutorial_console_client
version: 0.11.0
version: 1.0.0-dev
description: >
A Dart console client to implementation of the Apache Thrift tutorial
author: Apache Thrift Developers <dev@thrift.apache.org>

View File

@@ -16,7 +16,7 @@
# under the License.
name: tutorial_server
version: 0.11.0
version: 1.0.0-dev
description: A Dart server to support the Apache Thrift tutorial
author: Apache Thrift Developers <dev@thrift.apache.org>
homepage: http://thrift.apache.org

View File

@@ -97,13 +97,13 @@
<VersionInfoKeys>
<VersionInfoKeys Name="CompanyName"/>
<VersionInfoKeys Name="FileDescription">Thrift Tutorial</VersionInfoKeys>
<VersionInfoKeys Name="FileVersion">0.11.0.0</VersionInfoKeys>
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="InternalName">DelphiClient</VersionInfoKeys>
<VersionInfoKeys Name="LegalCopyright">Copyright © 2012 The Apache Software Foundation</VersionInfoKeys>
<VersionInfoKeys Name="LegalTrademarks"/>
<VersionInfoKeys Name="OriginalFilename">DelphiClient.exe</VersionInfoKeys>
<VersionInfoKeys Name="ProductName">Thrift</VersionInfoKeys>
<VersionInfoKeys Name="ProductVersion">0.11.0.0</VersionInfoKeys>
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="Comments"/>
</VersionInfoKeys>
<Source>

View File

@@ -96,13 +96,13 @@
<VersionInfoKeys>
<VersionInfoKeys Name="CompanyName"/>
<VersionInfoKeys Name="FileDescription">Thrift Tutorial</VersionInfoKeys>
<VersionInfoKeys Name="FileVersion">0.11.0.0</VersionInfoKeys>
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="InternalName">DelphiServer</VersionInfoKeys>
<VersionInfoKeys Name="LegalCopyright">Copyright © 2012 The Apache Software Foundation</VersionInfoKeys>
<VersionInfoKeys Name="LegalTrademarks"/>
<VersionInfoKeys Name="OriginalFilename">DelphiServer.exe</VersionInfoKeys>
<VersionInfoKeys Name="ProductName">Thrift</VersionInfoKeys>
<VersionInfoKeys Name="ProductVersion">0.11.0.0</VersionInfoKeys>
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="Comments"/>
</VersionInfoKeys>
<Source>

View File

@@ -17,10 +17,6 @@
# under the License.
#
if GOVERSION_LT_17
COMPILER_EXTRAFLAG=":legacy_context"
endif
gen-go/tutorial/calculator.go gen-go/shared/shared_service.go: $(top_srcdir)/tutorial/tutorial.thrift
$(THRIFT) --gen go$(COMPILER_EXTRAFLAG) -r $<
@@ -37,9 +33,6 @@ src/git.apache.org/thrift.git/lib/go/thrift:
ln -sf $(realpath $(top_srcdir)/lib/go/thrift) src/git.apache.org/thrift.git/lib/go/thrift
thirdparty-dep:
mkdir -p src/golang.org/x/net
GOPATH=`pwd`/gopath $(GO) get golang.org/x/net/context
ln -sf `pwd`/gopath/src/golang.org/x/net/context src/golang.org/x/net/context
tutorialserver: all
GOPATH=`pwd` $(GO) run src/*.go -server=true
@@ -61,9 +54,6 @@ EXTRA_DIST = \
src/handler.go \
src/server.go \
src/main.go \
src/go17.go \
src/handler_go17.go \
src/pre_go17.go \
server.crt \
server.key

View File

@@ -20,6 +20,7 @@ package main
*/
import (
"context"
"crypto/tls"
"fmt"
"tutorial"
@@ -27,6 +28,8 @@ import (
"git.apache.org/thrift.git/lib/go/thrift"
)
var defaultCtx = context.Background()
func handleClient(client *tutorial.CalculatorClient) (err error) {
client.Ping(defaultCtx)
fmt.Println("ping()")

View File

@@ -1,26 +0,0 @@
// +build go1.7
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package main
import "context"
var defaultCtx = context.Background()

View File

@@ -1,5 +1,3 @@
// +build !go1.7
package main
/*
@@ -22,12 +20,11 @@ package main
*/
import (
"context"
"fmt"
"shared"
"strconv"
"tutorial"
"golang.org/x/net/context"
)
type CalculatorHandler struct {

View File

@@ -1,104 +0,0 @@
// +build go1.7
package main
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import (
"context"
"fmt"
"shared"
"strconv"
"tutorial"
)
type CalculatorHandler struct {
log map[int]*shared.SharedStruct
}
func NewCalculatorHandler() *CalculatorHandler {
return &CalculatorHandler{log: make(map[int]*shared.SharedStruct)}
}
func (p *CalculatorHandler) Ping(ctx context.Context) (err error) {
fmt.Print("ping()\n")
return nil
}
func (p *CalculatorHandler) Add(ctx context.Context, num1 int32, num2 int32) (retval17 int32, err error) {
fmt.Print("add(", num1, ",", num2, ")\n")
return num1 + num2, nil
}
func (p *CalculatorHandler) Calculate(ctx context.Context, logid int32, w *tutorial.Work) (val int32, err error) {
fmt.Print("calculate(", logid, ", {", w.Op, ",", w.Num1, ",", w.Num2, "})\n")
switch w.Op {
case tutorial.Operation_ADD:
val = w.Num1 + w.Num2
break
case tutorial.Operation_SUBTRACT:
val = w.Num1 - w.Num2
break
case tutorial.Operation_MULTIPLY:
val = w.Num1 * w.Num2
break
case tutorial.Operation_DIVIDE:
if w.Num2 == 0 {
ouch := tutorial.NewInvalidOperation()
ouch.WhatOp = int32(w.Op)
ouch.Why = "Cannot divide by 0"
err = ouch
return
}
val = w.Num1 / w.Num2
break
default:
ouch := tutorial.NewInvalidOperation()
ouch.WhatOp = int32(w.Op)
ouch.Why = "Unknown operation"
err = ouch
return
}
entry := shared.NewSharedStruct()
entry.Key = logid
entry.Value = strconv.Itoa(int(val))
k := int(logid)
/*
oldvalue, exists := p.log[k]
if exists {
fmt.Print("Replacing ", oldvalue, " with ", entry, " for key ", k, "\n")
} else {
fmt.Print("Adding ", entry, " for key ", k, "\n")
}
*/
p.log[k] = entry
return val, err
}
func (p *CalculatorHandler) GetStruct(ctx context.Context, key int32) (*shared.SharedStruct, error) {
fmt.Print("getStruct(", key, ")\n")
v, _ := p.log[int(key)]
return v, nil
}
func (p *CalculatorHandler) Zip(ctx context.Context) (err error) {
fmt.Print("zip()\n")
return nil
}

View File

@@ -1,26 +0,0 @@
// +build !go1.7
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package main
import "golang.org/x/net/context"
var defaultCtx = context.Background()

View File

@@ -18,7 +18,7 @@
--
Name: ThriftTutorial
Version: 0.11.0
Version: 0.1.0
Cabal-Version: >= 1.4
License: OtherLicense
Category: Foreign

View File

@@ -25,11 +25,13 @@
<property name="build" location="build" />
<path id="libs.classpath">
<fileset dir="../../lib/java/build">
<include name="*.jar" />
<exclude name="-test.jar" />
<fileset dir="../../lib/java/build/libs">
<include name="libthrift*.jar" />
<exclude name="libthrift*test.jar" />
<exclude name="libthrift*javadoc.jar" />
<exclude name="libthrift*sources.jar" />
</fileset>
<fileset dir="../../lib/java/build/lib">
<fileset dir="../../lib/java/build/deps">
<include name="*.jar" />
</fileset>
</path>
@@ -42,7 +44,7 @@
<pathelement path="${build}" />
<pathelement path="tutorial.jar" />
</path>
<target name="init">
<tstamp />
<mkdir dir="${build}"/>

View File

@@ -31,11 +31,13 @@
<property name="thrift.java.dir" location="${thrift.dir}/lib/java" />
<path id="libs.classpath">
<fileset dir="../../lib/java/build">
<include name="*.jar" />
<exclude name="-test.jar" />
<fileset dir="${thrift.java.dir}/build/libs">
<include name="libthrift*.jar" />
<exclude name="libthrift*test.jar" />
<exclude name="libthrift*javadoc.jar" />
<exclude name="libthrift*sources.jar" />
</fileset>
<fileset dir="../../lib/java/build/lib">
<fileset dir="${thrift.java.dir}/build/deps">
<include name="*.jar" />
</fileset>
</path>
@@ -80,7 +82,7 @@
<arg line="--gen js -r ../tutorial.thrift"/>
</exec>
</target>
<target name="clean">
<delete dir="${build}" />
<delete dir="gen-js"/>

View File

@@ -1,4 +1,4 @@
// Licensed to the Apache Software Foundation(ASF) under one
// Licensed to the Apache Software Foundation(ASF) under one
// or more contributor license agreements.See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.The ASF licenses this file
@@ -42,14 +42,14 @@ namespace Client
{
Logger.LogInformation(@"
Usage:
Client.exe -h
Client.exe -help
will diplay help information
Client.exe -t:<transport> -p:<protocol> -mc:<numClients>
Client.exe -tr:<transport> -pr:<protocol> -mc:<numClients>
will run client with specified arguments (tcp transport and binary protocol by default) and with 1 client
Options:
-t (transport):
-tr (transport):
tcp - (default) tcp transport will be used (host - ""localhost"", port - 9090)
tcpbuffered - buffered transport over tcp will be used (host - ""localhost"", port - 9090)
namedpipe - namedpipe transport will be used (pipe address - "".test"")
@@ -57,7 +57,7 @@ Options:
tcptls - tcp tls transport will be used (host - ""localhost"", port - 9090)
framed - tcp framed transport will be used (host - ""localhost"", port - 9090)
-p (protocol):
-pr (protocol):
binary - (default) binary protocol will be used
compact - compact protocol will be used
json - json protocol will be used
@@ -67,7 +67,7 @@ Options:
<numClients> - number of multiple clients to connect to server (max 100, default 1)
Sample:
Client.exe -t:tcp -p:binary
Client.exe -tr:tcp -p:binary
");
}
@@ -75,7 +75,7 @@ Sample:
{
args = args ?? new string[0];
if (args.Any(x => x.StartsWith("-h", StringComparison.OrdinalIgnoreCase)))
if (args.Any(x => x.StartsWith("-help", StringComparison.OrdinalIgnoreCase)))
{
DisplayHelp();
return;
@@ -127,7 +127,7 @@ Sample:
private static TClientTransport GetTransport(string[] args)
{
var transport = args.FirstOrDefault(x => x.StartsWith("-t"))?.Split(':')?[1];
var transport = args.FirstOrDefault(x => x.StartsWith("-tr"))?.Split(':')?[1];
Transport selectedTransport;
if (Enum.TryParse(transport, true, out selectedTransport))
@@ -203,7 +203,7 @@ Sample:
private static Tuple<Protocol, TProtocol> GetProtocol(string[] args, TClientTransport transport)
{
var protocol = args.FirstOrDefault(x => x.StartsWith("-p"))?.Split(':')?[1];
var protocol = args.FirstOrDefault(x => x.StartsWith("-pr"))?.Split(':')?[1];
Protocol selectedProtocol;
if (Enum.TryParse(protocol, true, out selectedProtocol))
@@ -352,4 +352,4 @@ Sample:
Multiplexed
}
}
}
}

View File

@@ -0,0 +1,3 @@
# ignore for autogenerated files
/shared
/tutorial

View File

@@ -17,4 +17,14 @@
<ItemGroup>
<PackageReference Include="System.ServiceModel.Primitives" Version="[4.4,)" />
</ItemGroup>
<Target Name="PreBuild" BeforeTargets="_GenerateRestoreProjectSpec;Restore;Compile">
<Exec Condition="'$(OS)' == 'Windows_NT'" Command="where thrift" ConsoleToMSBuild="true">
<Output TaskParameter="ConsoleOutput" PropertyName="PathToThrift" />
</Exec>
<Exec Condition="Exists('$(PathToThrift)')" Command="$(PathToThrift) -out $(ProjectDir) -gen netcore:wcf,union,serial,hashcode -r ./../../tutorial.thrift" />
<Exec Condition="Exists('thrift')" Command="thrift -out $(ProjectDir) -gen netcore:wcf,union,serial,hashcode -r ./../../tutorial.thrift" />
<Exec Condition="Exists('./../../../compiler/cpp/thrift')" Command="./../../../compiler/cpp/thrift -out $(ProjectDir) -gen netcore:wcf,union,serial,hashcode -r ./../../tutorial.thrift" />
</Target>
</Project>

View File

@@ -19,39 +19,11 @@
SUBDIRS = .
THRIFT = $(top_builddir)/compiler/cpp/thrift
GENDIR = Interfaces/gen-netcore
# Due to a known issue with "dotnet restore" the Thrift.dll dependency cannot be resolved from cmdline.
# The problem does NOT affect Visual Studio builds, only cmdline.
# - For details see https://github.com/dotnet/cli/issues/3199 and related tickets.
# - Workaround is to temporarily copy the Thrift project into the solution
COPYCMD = cp -u -p -r
THRIFTCODE = \
Interfaces/Properties/AssemblyInfo.cs \
Client/Properties/AssemblyInfo.cs \
Client/Program.cs \
Server/Properties/AssemblyInfo.cs \
Server/Program.cs
all-local: \
Client.exe
Client.exe: $(THRIFTCODE)
$(MKDIR_P) $(GENDIR)
$(THRIFT) -gen netcore:wcf -r -out $(GENDIR) $(top_srcdir)/tutorial/tutorial.thrift
$(DOTNETCORE) --info
$(DOTNETCORE) restore
all-local:
$(DOTNETCORE) build
clean-local:
$(RM) Client.exe
$(RM) Server.exe
$(RM) Interfaces.dll
$(RM) -r $(GENDIR)
$(RM) -r Client/bin
$(RM) -r Client/obj
$(RM) -r Server/bin
@@ -60,16 +32,11 @@ clean-local:
$(RM) -r Interfaces/obj
EXTRA_DIST = \
$(THRIFTCODE) \
Tutorial.sln \
Interfaces/Interfaces.csproj \
Client/Client.csproj \
Client/ThriftTest.pfx \
Client/Properties/launchSettings.json \
Server/Server.csproj \
Server/ThriftTest.pfx \
Server/Properties/launchSettings.json \
build.cmd \
build.sh \
README.md
Client \
Interfaces \
README.md \
Server \
Tutorial.sln \
build.cmd \
build.sh

View File

@@ -1,11 +1,11 @@
# Building of samples for different platforms
# Reused components
- NET Core Standard 1.6 (SDK 1.0.0-preview2-003121)
- NET Core App 1.1
- NET Core Standard 2.0
- NET Core App 2.0
# How to build
- Download and install .NET Core SDK for your platform https://www.microsoft.com/net/core#windowsvs2015 (archive for SDK 1.0.0-preview2-003121 located by: https://github.com/dotnet/core/blob/master/release-notes/download-archive.md)
- Download and install the latest .NET Core SDK for your platform https://www.microsoft.com/net/core#windowsvs2015 (archive for SDK 1.0.0-preview2-003121 located by: https://github.com/dotnet/core/blob/master/release-notes/download-archive.md)
- Ensure that you have thrift.exe which supports netcore lib and it added to PATH
- Go to current folder
- Run **build.sh** or **build.cmd** from the root of cloned repository
@@ -18,16 +18,13 @@ Notes: dotnet run supports passing arguments to app after -- symbols (https://do
- build
- go to folder (Client/Server)
- run with specifying of correct parameters **dotnet run -t:tcp -p:multiplexed**, **dotnet run -help** (later, after migration to csproj and latest SDK will be possibility to use more usable form **dotnet run -- arguments**)
- run with specifying of correct parameters **dotnet run -tr:tcp -pr:multiplexed**, **dotnet run -help** (later, after migration to csproj and latest SDK will be possibility to use more usable form **dotnet run -- arguments**)
#Notes
- Migration to .NET Standard 2.0 planned for later (Q1 2017) according to https://blogs.msdn.microsoft.com/dotnet/2016/09/26/introducing-net-standard/
- Possible adding additional platforms after stabilization of .NET Core (runtimes, platforms (Red Hat Linux, OpenSuse, etc.)
#Known issues
- In trace logging mode you can see some not important internal exceptions
- Ubuntu 16.10 still not supported fully
- There is some problems with .NET Core CLI and usage specific -r|--runtime for building and publishing projects with different target frameworks (netstandard1.6 and netcoreapp1.1)
# Running of samples
Please install Thrift C# .NET Core library or copy sources and build them to correcly build and run samples
@@ -39,12 +36,12 @@ Usage:
Server.exe -h
will diplay help information
Server.exe -t:<transport> -p:<protocol>
Server.exe -tr:<transport> -pr:<protocol>
will run server with specified arguments (tcp transport and binary protocol by default)
Options:
-t (transport):
-tr (transport):
tcp - (default) tcp transport will be used (host - ""localhost"", port - 9090)
tcpbuffered - tcp buffered transport will be used (host - ""localhost"", port - 9090)
namedpipe - namedpipe transport will be used (pipe address - "".test"")
@@ -52,14 +49,14 @@ Options:
tcptls - tcp transport with tls will be used (host - ""localhost"", port - 9090)
framed - tcp framed transport will be used (host - ""localhost"", port - 9090)
-p (protocol):
-pr (protocol):
binary - (default) binary protocol will be used
compact - compact protocol will be used
json - json protocol will be used
Sample:
Server.exe -t:tcp
Server.exe -tr:tcp
**Remarks**:
@@ -75,12 +72,12 @@ Usage:
Client.exe -h
will diplay help information
Client.exe -t:<transport> -p:<protocol> -mc:<numClients>
Client.exe -tr:<transport> -pr:<protocol> -mc:<numClients>
will run client with specified arguments (tcp transport and binary protocol by default)
Options:
-t (transport):
-tr (transport):
tcp - (default) tcp transport will be used (host - ""localhost"", port - 9090)
tcpbuffered - buffered transport over tcp will be used (host - ""localhost"", port - 9090)
namedpipe - namedpipe transport will be used (pipe address - "".test"")
@@ -88,7 +85,7 @@ Options:
tcptls - tcp tls transport will be used (host - ""localhost"", port - 9090)
framed - tcp framed transport will be used (host - ""localhost"", port - 9090)
-p (protocol):
-pr (protocol):
binary - (default) binary protocol will be used
compact - compact protocol will be used
json - json protocol will be used
@@ -98,7 +95,7 @@ Options:
Sample:
Client.exe -t:tcp -p:binary -mc:10
Client.exe -tr:tcp -pr:binary -mc:10
Remarks:

View File

@@ -1,4 +1,4 @@
// Licensed to the Apache Software Foundation(ASF) under one
// Licensed to the Apache Software Foundation(ASF) under one
// or more contributor license agreements.See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.The ASF licenses this file
@@ -46,7 +46,7 @@ namespace Server
{
args = args ?? new string[0];
if (args.Any(x => x.StartsWith("-h", StringComparison.OrdinalIgnoreCase)))
if (args.Any(x => x.StartsWith("-help", StringComparison.OrdinalIgnoreCase)))
{
DisplayHelp();
return;
@@ -69,14 +69,14 @@ namespace Server
{
Logger.LogInformation(@"
Usage:
Server.exe -h
Server.exe -help
will diplay help information
Server.exe -t:<transport> -p:<protocol>
Server.exe -tr:<transport> -pr:<protocol>
will run server with specified arguments (tcp transport and binary protocol by default)
Options:
-t (transport):
-tr (transport):
tcp - (default) tcp transport will be used (host - ""localhost"", port - 9090)
tcpbuffered - tcp buffered transport will be used (host - ""localhost"", port - 9090)
namedpipe - namedpipe transport will be used (pipe address - "".test"")
@@ -84,14 +84,14 @@ Options:
tcptls - tcp transport with tls will be used (host - ""localhost"", port - 9090)
framed - tcp framed transport will be used (host - ""localhost"", port - 9090)
-p (protocol):
-pr (protocol):
binary - (default) binary protocol will be used
compact - compact protocol will be used
json - json protocol will be used
multiplexed - multiplexed protocol will be used
Sample:
Server.exe -t:tcp
Server.exe -tr:tcp
");
}
@@ -112,20 +112,18 @@ Sample:
private static Protocol GetProtocol(string[] args)
{
var transport = args.FirstOrDefault(x => x.StartsWith("-p"))?.Split(':')?[1];
Protocol selectedProtocol;
var transport = args.FirstOrDefault(x => x.StartsWith("-pr"))?.Split(':')?[1];
Enum.TryParse(transport, true, out selectedProtocol);
Enum.TryParse(transport, true, out Protocol selectedProtocol);
return selectedProtocol;
}
private static Transport GetTransport(string[] args)
{
var transport = args.FirstOrDefault(x => x.StartsWith("-t"))?.Split(':')?[1];
Transport selectedTransport;
var transport = args.FirstOrDefault(x => x.StartsWith("-tr"))?.Split(':')?[1];
Enum.TryParse(transport, true, out selectedTransport);
Enum.TryParse(transport, true, out Transport selectedTransport);
return selectedTransport;
}
@@ -288,11 +286,10 @@ Sample:
.UseKestrel()
.UseUrls("http://localhost:9090")
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>()
.Build();
host.StartAsync(cancellationToken); // was Run() in earlier .NET Core SDKs?
host.RunAsync(cancellationToken).GetAwaiter().GetResult();
}
public class Startup

View File

@@ -1,68 +1,78 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26114.2
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Thrift", "..\..\lib\netcore\Thrift\Thrift.csproj", "{C20EA2A9-7660-47DE-9A49-D1EF12FB2895}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Thrift", "..\..\lib\netcore\Thrift\Thrift.csproj", "{C20EA2A9-7660-47DE-9A49-D1EF12FB2895}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Interfaces", "Interfaces\Interfaces.csproj", "{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Interfaces", "Interfaces\Interfaces.csproj", "{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Client", "Client\Client.csproj", "{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Client", "Client\Client.csproj", "{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Server", "Server\Server.csproj", "{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Server", "Server\Server.csproj", "{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6850CF46-5467-4C65-BD78-871581C539FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6850CF46-5467-4C65-BD78-871581C539FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6850CF46-5467-4C65-BD78-871581C539FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6850CF46-5467-4C65-BD78-871581C539FC}.Release|Any CPU.Build.0 = Release|Any CPU
{C20EA2A9-7660-47DE-9A49-D1EF12FB2895}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C20EA2A9-7660-47DE-9A49-D1EF12FB2895}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C20EA2A9-7660-47DE-9A49-D1EF12FB2895}.Debug|x64.ActiveCfg = Debug|Any CPU
{C20EA2A9-7660-47DE-9A49-D1EF12FB2895}.Debug|x64.Build.0 = Debug|Any CPU
{C20EA2A9-7660-47DE-9A49-D1EF12FB2895}.Debug|x86.ActiveCfg = Debug|Any CPU
{C20EA2A9-7660-47DE-9A49-D1EF12FB2895}.Debug|x86.Build.0 = Debug|Any CPU
{C20EA2A9-7660-47DE-9A49-D1EF12FB2895}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C20EA2A9-7660-47DE-9A49-D1EF12FB2895}.Release|Any CPU.Build.0 = Release|Any CPU
{C20EA2A9-7660-47DE-9A49-D1EF12FB2895}.Release|x64.ActiveCfg = Release|Any CPU
{C20EA2A9-7660-47DE-9A49-D1EF12FB2895}.Release|x64.Build.0 = Release|Any CPU
{C20EA2A9-7660-47DE-9A49-D1EF12FB2895}.Release|x86.ActiveCfg = Release|Any CPU
{C20EA2A9-7660-47DE-9A49-D1EF12FB2895}.Release|x86.Build.0 = Release|Any CPU
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Debug|x64.ActiveCfg = Debug|x64
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Debug|x64.Build.0 = Debug|x64
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Debug|x86.ActiveCfg = Debug|x86
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Debug|x86.Build.0 = Debug|x86
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Debug|x64.ActiveCfg = Debug|Any CPU
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Debug|x64.Build.0 = Debug|Any CPU
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Debug|x86.ActiveCfg = Debug|Any CPU
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Debug|x86.Build.0 = Debug|Any CPU
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Release|Any CPU.Build.0 = Release|Any CPU
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Release|x64.ActiveCfg = Release|x64
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Release|x64.Build.0 = Release|x64
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Release|x86.ActiveCfg = Release|x86
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Release|x86.Build.0 = Release|x86
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Release|x64.ActiveCfg = Release|Any CPU
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Release|x64.Build.0 = Release|Any CPU
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Release|x86.ActiveCfg = Release|Any CPU
{B9E24D84-2712-4158-8F1A-DDE44CD1BB0A}.Release|x86.Build.0 = Release|Any CPU
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Debug|x64.ActiveCfg = Debug|x64
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Debug|x64.Build.0 = Debug|x64
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Debug|x86.ActiveCfg = Debug|x86
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Debug|x86.Build.0 = Debug|x86
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Debug|x64.ActiveCfg = Debug|Any CPU
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Debug|x64.Build.0 = Debug|Any CPU
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Debug|x86.ActiveCfg = Debug|Any CPU
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Debug|x86.Build.0 = Debug|Any CPU
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Release|Any CPU.Build.0 = Release|Any CPU
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Release|x64.ActiveCfg = Release|x64
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Release|x64.Build.0 = Release|x64
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Release|x86.ActiveCfg = Release|x86
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Release|x86.Build.0 = Release|x86
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Release|x64.ActiveCfg = Release|Any CPU
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Release|x64.Build.0 = Release|Any CPU
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Release|x86.ActiveCfg = Release|Any CPU
{E4CA1EF0-B181-4A5D-A02C-DB0750A59CDF}.Release|x86.Build.0 = Release|Any CPU
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Debug|x64.ActiveCfg = Debug|x64
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Debug|x64.Build.0 = Debug|x64
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Debug|x86.ActiveCfg = Debug|x86
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Debug|x86.Build.0 = Debug|x86
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Debug|x64.ActiveCfg = Debug|Any CPU
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Debug|x64.Build.0 = Debug|Any CPU
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Debug|x86.ActiveCfg = Debug|Any CPU
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Debug|x86.Build.0 = Debug|Any CPU
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Release|Any CPU.Build.0 = Release|Any CPU
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Release|x64.ActiveCfg = Release|x64
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Release|x64.Build.0 = Release|x64
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Release|x86.ActiveCfg = Release|x86
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Release|x86.Build.0 = Release|x86
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Release|x64.ActiveCfg = Release|Any CPU
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Release|x64.Build.0 = Release|Any CPU
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Release|x86.ActiveCfg = Release|Any CPU
{E08F5B84-2B4A-4E09-82D1-E0715775CE5E}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {070A5D1D-B29D-4603-999D-693DB444AD0D}
EndGlobalSection
EndGlobal

View File

@@ -19,12 +19,7 @@ rem * under the License.
rem */
setlocal
cd Interfaces
thrift -gen netcore:wcf -r ..\..\tutorial.thrift
cd ..
dotnet --info
dotnet restore
dotnet build
:eof

View File

@@ -22,10 +22,5 @@
#exit if any command fails
set -e
cd Interfaces
../../../compiler/cpp/thrift -gen netcore:wcf -r ../../tutorial.thrift
cd ..
dotnet --info
dotnet restore
dotnet build

View File

@@ -1,5 +1,5 @@
Name: tutorial
Version: 0.11.0
Version: 1.0
OASISFormat: 0.3
Synopsis: OCaml Tutorial example
Authors: Apache Thrift Developers <dev@thrift.apache.org>

View File

@@ -5,7 +5,7 @@ namespace tutorial\php;
error_reporting(E_ALL);
require_once __DIR__.'/../../lib/php/lib/Thrift/ClassLoader/ThriftClassLoader.php';
require_once __DIR__.'/../../lib/php/lib/ClassLoader/ThriftClassLoader.php';
use Thrift\ClassLoader\ThriftClassLoader;

View File

@@ -5,7 +5,7 @@ namespace tutorial\php;
error_reporting(E_ALL);
require_once __DIR__.'/../../lib/php/lib/Thrift/ClassLoader/ThriftClassLoader.php';
require_once __DIR__.'/../../lib/php/lib/ClassLoader/ThriftClassLoader.php';
use Thrift\ClassLoader\ThriftClassLoader;

View File

@@ -22,6 +22,7 @@
* these definitions.
*/
namespace cl shared
namespace cpp shared
namespace d share // "shared" would collide with the eponymous D keyword.
namespace dart shared

View File

@@ -62,6 +62,8 @@ include "shared.thrift"
* Thrift files can namespace, package, or prefix their output in various
* target languages.
*/
namespace cl tutorial
namespace cpp tutorial
namespace d tutorial
namespace dart tutorial