Stream流與Lambda表達式(一) 雜談

一、流 轉換為數組、集合

package com.java.design.java8.Stream;import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;/*** @author 陳楊*/@SpringBootTest
@RunWith(SpringRunner.class)
public class ListChange {private Stream<String> stream = Stream.of("Kirito", "Asuna", "Illyasviel", "Sakura");@Testpublic void testListChange() {//   將流轉換為數組//   System.out.println("-------------將流轉換為數組---------------");//   String[] array = stream.toArray(len -> new String[len]);//   String[] array = stream.toArray(String[]::new);//   Arrays.asList(array).stream().forEach(System.out::println);//    將流轉換為集合//    System.out.println("-------------將流轉換為集合---------------");//    System.out.println("-------Collectors.toList()解析-----------");/*    public static <T>*               Collector<T, ?, List<T>> toList() {*          return new CollectorImpl<>((Supplier<List<T>>) ArrayList::new, List::add,*                 (left, right) -> { left.addAll(right); return left; },*                 CH_ID);}*///    List<String> list = stream.collect(Collectors.toList());//    List<String> linkedList = stream.collect(LinkedList::new,LinkedList::add,LinkedList::addAll);List<String> list = stream.collect(ArrayList::new, ArrayList::add, ArrayList::addAll);list.forEach(System.out::println);System.out.println(list.getClass());//    System.out.println("-------Collectors.toCollection()解析-----");/*    public static <T, C extends Collection<T>>*        Collector<T, ?, C> toCollection(Supplier<C> collectionFactory) {*              return new CollectorImpl<>(collectionFactory, Collection<T>::add,*             (r1, r2) -> { r1.addAll(r2); return r1; },*              CH_ID);}*///    List<String> list =stream.collect(Collectors.toCollection(ArrayList::new));//    List<String> linkedList =stream.collect(Collectors.toCollection(ArrayList::new));//    Set<String> treeSet =stream.collect(Collectors.toCollection(TreeSet::new));//    Set<String> hashSet =stream.collect(Collectors.toCollection(HashSet::new));}}
  .   ____          _            __ _ _/\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \\\/  ___)| |_)| | | | | || (_| |  ) ) ) )'  |____| .__|_| |_|_| |_\__, | / / / /=========|_|==============|___/=/_/_/_/:: Spring Boot ::        (v2.1.2.RELEASE)2019-02-20 15:47:22.310  INFO 1348 --- [           main] com.java.design.java8.Stream.ListChange  : Starting ListChange on DESKTOP-87RMBG4 with PID 1348 (started by 46250 in E:\IdeaProjects\design)
2019-02-20 15:47:22.311  INFO 1348 --- [           main] com.java.design.java8.Stream.ListChange  : No active profile set, falling back to default profiles: default
2019-02-20 15:47:22.947  INFO 1348 --- [           main] com.java.design.java8.Stream.ListChange  : Started ListChange in 0.914 seconds (JVM running for 1.774)
Kirito
Asuna
Illyasviel
Sakura
class java.util.ArrayList

二、集合排序

package com.java.design.java8.Stream;import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;import java.util.*;/*** @author 陳楊*/@SpringBootTest
@RunWith(SpringRunner.class)
public class ComparatorDetail {private List<String> names;@Beforepublic void init() {names = Arrays.asList("Kirito", "Asuna", "Sinon", "Yuuki", "Alice");}public void println() {System.out.println(names);System.out.println("-----------------------------------------\n");}@Testpublic void testComparatorDetail() {//  對名字進行升序排序Collections.sort(names);this.println();//  對名字進行降序排序names.sort(Collections.reverseOrder());this.println();//  按照姓名的字符串長度升序排序 相同長度-->比較前兩個字符-->按照字符的ASCII碼大小升序排序names.sort(Comparator.comparingInt(String::length).thenComparing(str -> str.charAt(0)).thenComparing(str -> str.charAt(1)));this.println();//  按照姓名的字符串長度降序排序 相同長度-->比較前兩個字符-->按照字符的ASCII碼大小降序排序names.sort(Comparator.comparingInt(String::length).thenComparing(str -> str.charAt(0)).thenComparing(str -> str.charAt(1)).reversed());this.println();//  按照姓名的字符串長度降序排序 相同長度-->按照字符的ASCII碼大小排序(不區分大小寫)names.sort(Comparator.comparingInt(String::length).thenComparing(String.CASE_INSENSITIVE_ORDER));this.println();}
}
  .   ____          _            __ _ _/\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \\\/  ___)| |_)| | | | | || (_| |  ) ) ) )'  |____| .__|_| |_|_| |_\__, | / / / /=========|_|==============|___/=/_/_/_/:: Spring Boot ::        (v2.1.2.RELEASE)2019-02-20 15:58:39.959  INFO 4588 --- [           main] c.j.d.java8.Stream.ComparatorDetail      : Starting ComparatorDetail on DESKTOP-87RMBG4 with PID 4588 (started by 46250 in E:\IdeaProjects\design)
2019-02-20 15:58:39.962  INFO 4588 --- [           main] c.j.d.java8.Stream.ComparatorDetail      : No active profile set, falling back to default profiles: default
2019-02-20 15:58:40.459  INFO 4588 --- [           main] c.j.d.java8.Stream.ComparatorDetail      : Started ComparatorDetail in 0.729 seconds (JVM running for 1.462)
[Alice, Asuna, Kirito, Sinon, Yuuki]
-----------------------------------------[Yuuki, Sinon, Kirito, Asuna, Alice]
-----------------------------------------[Alice, Asuna, Sinon, Yuuki, Kirito]
-----------------------------------------[Kirito, Yuuki, Sinon, Asuna, Alice]
-----------------------------------------[Alice, Asuna, Sinon, Yuuki, Kirito]
-----------------------------------------

三、Stream之map(Lambda)

package com.java.design.java8.Stream;import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;/*** @author 陳楊*/@SpringBootTest
@RunWith(SpringRunner.class)
public class StringOperation {private List<String> list = Arrays.asList("Kirito", "Asuna", "Illyasviel", "Sakura");private List<List<String>> listMap =Arrays.asList(Collections.singletonList("Kirito"), Collections.singletonList("Asuna"),Collections.singletonList("Illyasviel"), Collections.singletonList("Sakura"));private List<List<String>> listFlatMap =Arrays.asList(Collections.singletonList("Kirito"), Collections.singletonList("Asuna"),Collections.singletonList("Illyasviel"), Collections.singletonList("Sakura"));@Testpublic void testStringOperation() {//    集合中 每個字符串  按照排列先后順序拼接 形成一個長字符串//    String concat =//    list.stream().collect(StringBuilder::new, StringBuilder::append, StringBuilder::append).toString();//    String concat = list.stream().collect(Collectors.joining());//    System.out.println(concat);//    集合中 對每個字符串元素  將所有字母變成大寫字母System.out.println("-----------------------------------------\n");List<String> upperCase = list.stream().map(String::toUpperCase).collect(Collectors.toList());upperCase.forEach(System.out::println);//    集合中 對每個字符串元素  將所有字母變成小寫字母System.out.println("-----------------------------------------\n");List<String> lowerCase = list.stream().map(String::toLowerCase).collect(Collectors.toList());lowerCase.forEach(System.out::println);System.out.println("-----------------------------------------\n");System.out.println("FlatMap與Map的區別:\n");//    map:  對多個list 分別map Fuction 映射  形成多個listSystem.out.println("-----------------------------------------\n");System.out.println("進行map映射:");List<List<String>> upperMap = listMap.stream().map(list -> list.stream().map(String::toUpperCase).collect(Collectors.toList())).collect(Collectors.toList());upperMap.forEach(System.out::println);//    FlatMap: 對多個list 進行flat扁平化 后再進行map Fuction 映射  形成一個listSystem.out.println("-----------------------------------------\n");System.out.println("FlatMap扁平化進行map映射:");List<String> upperFlatMap = listFlatMap.stream().flatMap(list -> list.stream().map(String::toUpperCase)).collect(Collectors.toList());upperFlatMap.forEach(System.out::println);}
}
  .   ____          _            __ _ _/\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \\\/  ___)| |_)| | | | | || (_| |  ) ) ) )'  |____| .__|_| |_|_| |_\__, | / / / /=========|_|==============|___/=/_/_/_/:: Spring Boot ::        (v2.1.2.RELEASE)2019-02-20 15:50:07.423  INFO 8208 --- [           main] c.j.design.java8.Stream.StringOperation  : Starting StringOperation on DESKTOP-87RMBG4 with PID 8208 (started by 46250 in E:\IdeaProjects\design)
2019-02-20 15:50:07.424  INFO 8208 --- [           main] c.j.design.java8.Stream.StringOperation  : No active profile set, falling back to default profiles: default
2019-02-20 15:50:07.917  INFO 8208 --- [           main] c.j.design.java8.Stream.StringOperation  : Started StringOperation in 0.717 seconds (JVM running for 1.5)
-----------------------------------------KIRITO
ASUNA
ILLYASVIEL
SAKURA
-----------------------------------------kirito
asuna
illyasviel
sakura
-----------------------------------------FlatMap與Map的區別:-----------------------------------------進行map映射:
[KIRITO]
[ASUNA]
[ILLYASVIEL]
[SAKURA]
-----------------------------------------FlatMap扁平化進行map映射:
KIRITO
ASUNA
ILLYASVIEL
SAKURA

四、內部迭代與外部迭代

package com.java.design.java8.Stream;import com.java.design.java8.entity.Student;
import com.java.design.java8.entity.Students;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;import java.util.*;/*** @author 陳楊*/@SpringBootTest
@RunWith(SpringRunner.class)
//迭代本質
public class IterativeEssence {private List<Student> students;@Beforepublic void init() {students = new Students().init();}@Testpublic void testIterativeEssence() {//    需求: select name from students where  age > 14 and addr ="Sword Art Online"  order by id desc ;//    外部迭代System.out.println("-----------------------------------------\n");System.out.println("外部迭代");List<Student> list = new ArrayList<>();for (Student student : students) {if (student.getAge() > 14 && student.getAddr().equals("Sword Art Online")) {list.add(student);}}list.sort(Comparator.comparingInt(Student::getId));for (Student student : list) {System.out.println(student.getName());}//    內部迭代System.out.println("-----------------------------------------\n");System.out.println("內部迭代");students.stream().filter(student -> student.getAge() > 14).filter(student -> student.getAddr().equals("Sword Art Online")).sorted(Comparator.comparingInt(Student::getId)).forEach(student -> System.out.println(student.getName()));//    備注://    內部迭代與SQL語句屬于描述性語言//    集合關注的是數據與數據存儲//    流關注的是數據的計算//    流中間操作返回的都是Stream對象 泛型取決于中間操作的類型//    流終止操作: 無返回值(forEach) 返回值是其他類型}}
  .   ____          _            __ _ _/\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \\\/  ___)| |_)| | | | | || (_| |  ) ) ) )'  |____| .__|_| |_|_| |_\__, | / / / /=========|_|==============|___/=/_/_/_/:: Spring Boot ::        (v2.1.2.RELEASE)2019-02-20 15:53:03.633  INFO 8864 --- [           main] c.j.d.java8.Stream.IterativeEssence      : Starting IterativeEssence on DESKTOP-87RMBG4 with PID 8864 (started by 46250 in E:\IdeaProjects\design)
2019-02-20 15:53:03.640  INFO 8864 --- [           main] c.j.d.java8.Stream.IterativeEssence      : No active profile set, falling back to default profiles: default
2019-02-20 15:53:04.167  INFO 8864 --- [           main] c.j.d.java8.Stream.IterativeEssence      : Started IterativeEssence in 0.746 seconds (JVM running for 1.455)
-----------------------------------------外部迭代
Kirito
Asuna
-----------------------------------------內部迭代
Kirito
Asuna

五、串行流與并行流 簡單性能測試

package com.java.design.java8.Stream;import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.IntStream;/*** @author 陳楊*/@RunWith(SpringRunner.class)
@SpringBootTest
public class ErgodicString {private List<String> uuid;private long startTime;private long endTime;private long parallelEndTime;@Beforepublic void init() {uuid = new ArrayList<>(10000000);IntStream.range(0, 10000000).forEach(i -> uuid.add(UUID.randomUUID().toString()));}public void testNormal() {startTime = System.nanoTime();uuid.stream().sorted().collect(Collectors.toList());endTime = System.nanoTime();long millis = TimeUnit.NANOSECONDS.toMillis(endTime - startTime);System.out.println("單線程" + millis);}public void testParallel() {startTime = System.nanoTime();uuid.parallelStream().sorted().collect(Collectors.toList());parallelEndTime = System.nanoTime();long millis = TimeUnit.NANOSECONDS.toMillis(parallelEndTime - startTime);System.out.println("多線程" + millis);}@Testpublic void testErgodicString() {List<String> list = Arrays.asList("Kirito", "Asuna", "Illyasviel", "Sakura");//  需求: 將數組中每個元素各個字母大寫 并放入集合System.out.println("--------------------串行流stream---------------------");// spliterator 分割迭代器//  串行流stream() 單線程處理/**  default Stream<E> stream() {*       return StreamSupport.stream(spliterator(), false);}*///  List<String> collect = list.stream().map(str -> str.toUpperCase()).collect(Collectors.toList());//  R apply(T t); toUpperCase() 沒有參數作為輸入//  但把調用toUpperCase的對象作為T作為輸入 返回的R是return的對象結果//  List<String> collect = list.stream().map(String::toUpperCase).collect(Collectors.toList());Function<String, String> function = String::toUpperCase;//等價于 (String str)  -> str.toUpperCase()//方法引用 類的類型::實例方法 對應的lambda表達式 第一個輸入參數 是調用此方法的對象List<String> collect = list.stream().map(function).collect(Collectors.toList());collect.forEach(System.out::println);this.testNormal();System.out.println("-----------------并行流parallelStream------------------");//  并行流parallelStream() 多線程處理/**  default Stream<E> parallelStream() {*       return StreamSupport.stream(spliterator(), true);}*/List<String> parallelCollect = list.parallelStream().map(str -> str.toUpperCase()).collect(Collectors.toList());parallelCollect.forEach(System.out::println);this.testParallel();}}
  .   ____          _            __ _ _/\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \\\/  ___)| |_)| | | | | || (_| |  ) ) ) )'  |____| .__|_| |_|_| |_\__, | / / / /=========|_|==============|___/=/_/_/_/:: Spring Boot ::        (v2.1.2.RELEASE)2019-02-20 15:54:54.321  INFO 7356 --- [           main] c.j.design.java8.Stream.ErgodicString    : Starting ErgodicString on DESKTOP-87RMBG4 with PID 7356 (started by 46250 in E:\IdeaProjects\design)
2019-02-20 15:54:54.323  INFO 7356 --- [           main] c.j.design.java8.Stream.ErgodicString    : No active profile set, falling back to default profiles: default
2019-02-20 15:54:54.817  INFO 7356 --- [           main] c.j.design.java8.Stream.ErgodicString    : Started ErgodicString in 0.705 seconds (JVM running for 1.528)
--------------------串行流stream---------------------
KIRITO
ASUNA
ILLYASVIEL
SAKURA
單線程10590
-----------------并行流parallelStream------------------
KIRITO
ASUNA
ILLYASVIEL
SAKURA
多線程3313

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/536933.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/536933.shtml
英文地址,請注明出處:http://en.pswp.cn/news/536933.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

一年java工作經驗-面試總結

*************************************優雅的分割線 ********************************** 分享一波:程序員賺外快-必看的巔峰干貨 如果以上內容對你覺得有用,并想獲取更多的賺錢方式和免費的技術教程 請關注微信公眾號:HB荷包 一個能讓你學習技術和賺錢方法的公眾號,持續更…

linux mysql python包_03_mysql-python模塊, linux環境下python2,python3的

---恢復內容開始---1、Python2 正常[rootIP ~]#pip install mysql-pythonDEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 wont be maintained after that date. A future version of pip will drop …

我的這套VuePress主題你熟悉吧

最近熬了很多個夜晚, 踩坑無數, 終于寫出了用VuePress驅動的主題. 只需體驗三分鐘&#xff0c;你就會跟我一樣&#xff0c;愛上這款主題. vuepress-theme-indigo-material, 已經發布到npm, 請客官享用~~ 介紹 vuepress-theme-indigo-material 的原主題是hexo-theme-indigo, git…

兩年Java工作經驗應該會些什么技術

*************************************優雅的分割線 ********************************** 分享一波:程序員賺外快-必看的巔峰干貨 如果以上內容對你覺得有用,并想獲取更多的賺錢方式和免費的技術教程 請關注微信公眾號:HB荷包 一個能讓你學習技術和賺錢方法的公眾號,持續更…

centos 6 mysql 5.7.13 編譯安裝_Centos 6.5 下面 源碼編譯 安裝 Mysql 5.7.13

安裝軟件依賴包yum -y install gcc gcc-c ncurses ncurses-devel cmake下載軟件包cd /usr/local/srcwget https://downloads.mysql.com/archives/get/file/mysql-5.7.13.tar.gz --no-check-certificate下載 boost 庫&#xff0c;MySQL 5.7.5 開始Boost庫是必需的cd /usr/loca…

LeetCode 237. 刪除鏈表中的節點(Python3)

題目&#xff1a; 請編寫一個函數&#xff0c;使其可以刪除某個鏈表中給定的&#xff08;非末尾&#xff09;節點&#xff0c;你將只被給定要求被刪除的節點。 現有一個鏈表 -- head [4,5,1,9]&#xff0c;它可以表示為: 示例 1: 輸入: head [4,5,1,9], node 5 輸出: [4,1,9…

使用Uniapp隨手記錄知識點

使用uniapp隨手記錄知識點 1 組件內置組件擴展組件 2 vuex狀態管理使用流程mapState 輔助函數gettersMutation 1 組件 內置組件 內置組件內主要包含一些基礎的view button video scroll-view等內置基礎組件&#xff0c;滿足基礎場景 擴展組件 擴展組件是uniapp封裝了一些成…

一年Java經驗應該會些什么

*************************************優雅的分割線 ********************************** 分享一波:程序員賺外快-必看的巔峰干貨 如果以上內容對你覺得有用,并想獲取更多的賺錢方式和免費的技術教程 請關注微信公眾號:HB荷包 一個能讓你學習技術和賺錢方法的公眾號,持續更…

mysql查詢各類課程的總學分_基于jsp+mysql的JSP學生選課信息管理系統

運行環境: 最好是java jdk 1.8&#xff0c;我們在這個平臺上運行的。其他版本理論上也可以。IDE環境&#xff1a; Eclipse,Myeclipse,IDEA都可以硬件環境&#xff1a; windows 7/8/10 2G內存以上(推薦4G&#xff0c;4G以上更好)可以實現&#xff1a; 學生&#xff0c;教師角色的…

80端口占用分析

SQL Server 2008 里面的組件——SQL Server Reporting Services (MSSQLSERVER)。是 SQL Server 的日志系統&#xff0c;就是他好端端的突然占用了80端口&#xff0c;而且對于普通人來講&#xff0c;這個組件的作用沒啥用&#xff0c;關掉也是節約資源。 關閉服務 ReportServer …

三年java經驗應該會什么?

*************************************優雅的分割線 ********************************** 分享一波:程序員賺外快-必看的巔峰干貨 如果以上內容對你覺得有用,并想獲取更多的賺錢方式和免費的技術教程 請關注微信公眾號:HB荷包 一個能讓你學習技術和賺錢方法的公眾號,持續更…

python call agilent com_PyVISA通過RS232(USB)與安捷倫34970A通信時出現超時錯誤

這是我第一次嘗試使用Pyvisa&#xff0c;以便使用RS232連接(使用USB端口)與Agilent 34970A進行通信。在這就是發生在我身上的事情&#xff0c;插入基本的第一行&#xff1a;IN: import visaIN: rmvisa.ResourceManager()IN: print rm.list_resources()(uASRL4::INSTR,)IN: inst…

python加法運算符可以用來連接字符串并生成新字符串_中國大學MOOCPython語言入門網課答案...

中國大學MOOCPython語言入門網課答案表達式int(40.5)的值為____________。表達式160.5的值為____________________。python程序只能使用源代碼進行運行&#xff0c;不能打包成可執行文件。python語句list(range(1,10,3))執行結果為___________________。pip命令也支持擴展名為.…

全是滿滿的技術文檔

*************************************話不多說-先上教程 ********************************** 完整躺賺教程(不需任何技術,照做就能賺錢):點擊此處獲取 提取碼&#xff1a;6666 被動收入教程(需要一定的技術,會搭建服務器,會發布項目<教程里面會教你>):點擊此處獲取 提…

JavaScript面試的完美指南(開發者視角)

2019獨角獸企業重金招聘Python工程師標準>>> 摘要&#xff1a; 面試季手冊。 原文&#xff1a;javascript 面試的完美指南(開發者視角)作者&#xff1a;前端小智Fundebug經授權轉載&#xff0c;版權歸原作者所有。 為了說明 JS 面試的復雜性&#xff0c;首先&#x…

電腦上mysql數據庫無法登錄_無法遠程登入MySQL數據庫的幾種解決辦法MySQL綜合 -電腦資料...

方法一&#xff1a;嘗試用MySQL Adminstrator GUI Tool登入MySQL Server&#xff0c;Server卻回復錯誤訊息&#xff1a;Host 60-248-32-13.HINET-IP.hinet.net is not allowed to connect to thisMySQL server這個是因為權限的問題&#xff0c;處理方式如下&#xff1a;shell&g…

如何優化 App 的啟動耗時?

原文&#xff1a;iOS面試題大全 iOS 的 App 啟動主要分為以下步驟&#xff1a; 打開 App&#xff0c;系統內核進行初始化跳轉到 dyld 執行。這個過程包括這些步驟&#xff1a;1&#xff09;分配虛擬內存空間&#xff1b;2&#xff09;fork 進程&#xff1b;3&#xff09;加載 M…

windows qt 不能debug_linux配置vlc-qt

vlc-qt 是基于vlc庫&#xff0c;用于開發音頻視頻應用&#xff0c;性能優秀。vlc-qt/vlc-qt?github.com使用vlc-qt首先需要編譯vlc-qt &#xff08;windows可以下載使用編譯好的&#xff0c;但是只能用在release模式&#xff09;&#xff08;在windows系統中&#xff09;使用w…

idou老師教你學Istio 27:解讀Mixer Report流程

1、概述 Mixer是Istio的核心組件&#xff0c;提供了遙測數據收集的功能&#xff0c;能夠實時采集服務的請求狀態等信息&#xff0c;以達到監控服務狀態目的。 1.1 核心功能 ?前置檢查&#xff08;Check&#xff09;&#xff1a;某服務接收并響應外部請求前&#xff0c;先通過E…

mysql刪除密碼代碼_mysql 用戶新建、受權、刪除、密碼修改

mysql 用戶新建、授權、刪除、密碼修改首先要聲明一下&#xff1a;一般情況下&#xff0c;修改MySQL密碼&#xff0c;授權&#xff0c;是需要有mysql里的root權限的。注&#xff1a;本操作是在WIN命令提示符下&#xff0c;phpMyAdmin同樣適用。用戶&#xff1a;phplamp 用戶數…